galpy.orbit.Orbit.integrate¶
- Orbit.integrate(t, pot, method='symplec4_c', progressbar=True, dt=None, numcores=2, force_map=False, rtol=None, atol=None)[source]¶
- Orbit.integrate(pot: planarPotential, method='symplec4_c', progressbar=True, dt=None, numcores=2, force_map=False, rtol=None, atol=None)
- Orbit.integrate(pot: Potential, method='symplec4_c', progressbar=True, dt=None, numcores=2, force_map=False, rtol=None, atol=None)
- Orbit.integrate(pot: list, method='symplec4_c', progressbar=True, dt=None, numcores=2, force_map=False, rtol=None, atol=None)
Integrate the orbit instance.
This method supports two call patterns:
Explicit time array:
integrate(t, pot, ...)- integrate for the specified time array tAuto-time default:
integrate(pot, ...)- Integrate for 10 dynamical times (default)
- Parameters:
t (list, numpy.ndarray, Quantity, or Potential) –
If array-like: List of equispaced times at which to compute the orbit. The initial condition is t[0]. (note that for method=’odeint’, method=’dop853’, and method=’dop853_c’, the time array can be non-equispaced). If the orbit has already been integrated and the new time array continues from the end point of the previous integration (t[0] equals the last time of the previous integration), the orbit will be continued and the two integrations will be merged. Similarly, if t[0] equals the first time of a previous integration and the new time array goes in the opposite direction, the orbit will be integrated backward and prepended to the existing integration. The time array can also be per-orbit, with shape
orbit.shape + (nt,)(each orbit integrated on its own grid); in this case continuation is not supported and the new integration always starts from the original initial conditions. Continuation is also disabled after abruteSOSorSOScall, which rewriteself.tinto a non-standard form.If Potential: Integrate for 10 dynamical times (default auto-time behavior). In this case, this parameter is the potential and the second parameter (pot) becomes method.
pot (Potential, DissipativeForce, or a combined force/potential formed using addition (pot1+pot2+force3+…)) – Gravitational field to integrate the orbit in.
method (str, optional) – Integration method to use. Default is ‘symplec4_c’. See Notes for more information.
progressbar (bool, optional) – If True, display a tqdm progress bar when integrating multiple orbits (requires tqdm to be installed!). Default is True.
dt (int or Quantity, optional) – If set, force the integrator to use this basic stepsize; must be an integer divisor of output stepsize (only works for the C integrators that use a fixed stepsize). Can be Quantity.
numcores (int, optional) – Number of cores to use for Python-based multiprocessing (pure Python or using force_map=True). Default is OMP_NUM_THREADS.
force_map (bool, optional) – If True, force use of Python-based multiprocessing (not recommended). Default is False.
rtol (float, optional) – Relative tolerance. Default is None.
atol (float, optional) – Absolute tolerance. Default is None.
- Returns:
Get the actual orbit using getOrbit() or access the individual attributes (e.g., R, vR, etc.).
- Return type:
None
Notes
Possible integration methods are:
‘odeint’ for scipy’s odeint
‘leapfrog’ for a simple leapfrog implementation
‘leapfrog_c’ for a simple leapfrog implementation in C
‘symplec4_c’ for a 4th order symplectic integrator in C
‘symplec6_c’ for a 6th order symplectic integrator in C
‘rk4_c’ for a 4th-order Runge-Kutta integrator in C
‘rk6_c’ for a 6-th order Runge-Kutta integrator in C
‘dopr54_c’ for a 5-4 Dormand-Prince integrator in C
‘dop853’ for a 8-5-3 Dormand-Prince integrator in Python
‘dop853_c’ for a 8-5-3 Dormand-Prince integrator in C
‘ias15_c’ for an adaptive 15th order integrator using Gauß-Radau quadrature (see IAS15 paper) in C
When continuing an integration, the time arrays do not need to have the same number of points or the same spacing. However, for methods that require equispaced times, each individual time array must be equispaced.
2018-10-13 - Written as parallel_map applied to regular Orbit integration - Mathew Bub (UofT)
2018-12-26 - Written to use OpenMP C implementation - Bovy (UofT)
2024-11-10 - Added support for continuing integrations - Bovy (UofT)
2026-02-09 - Added automatic time determination - Bovy (UofT)