IAS15#

class IAS15(dt: float, min_dt: float, dynamics: Callable[[float, list[float]], list[float]], n_state: int = 6)#

Bases: object

Implicit integrator with Adaptive timeStepping, 15th order (IAS15).

This is a Rust implementation of the IAS15 algorithm [1] that interfaces with Python.

IAS15 integrates second-order systems \(\ddot{\mathbf{y}} = \mathbf{F}(t, \mathbf{y}, \dot{\mathbf{y}})\): the first n_state / 2 rows of the state are positions, the rest velocities, and dynamics returns the derivative of the full state. Over a step \(\Delta t\), with \(h = (t - t_0)/\Delta t \in [0, 1]\), the force is expanded as

\[\mathbf{F}(h) = \mathbf{F}_0 + \sum_{k=0}^{6} \mathbf{b}_k\, h^{k+1},\]

and integrated term by term [2]:

\[\begin{split}\dot{\mathbf{y}}(h) &= \dot{\mathbf{y}}_0 + h\,\Delta t \left(\mathbf{F}_0 + \sum_{k=0}^{6} \frac{\mathbf{b}_k\, h^{k+1}}{k+2}\right), \\ \mathbf{y}(h) &= \mathbf{y}_0 + h\,\Delta t\,\dot{\mathbf{y}}_0 + \frac{(h\,\Delta t)^2}{2}\left(\mathbf{F}_0 + \sum_{k=0}^{6} \frac{2\,\mathbf{b}_k\, h^{k+1}}{(k+2)(k+3)}\right).\end{split}\]

The \(\mathbf{b}_k\) come from a predictor-corrector iteration over the seven Gauss-Radau nodes \(h_1, \dots, h_7\), with compensated summation. It stops when \(\max|\delta\mathbf{b}_6| / \max|\mathbf{F}|\) falls below \(10^{-16}\), stops decreasing, or after 12 iterations. The last term sets the next step:

\[\tilde{\epsilon} = \frac{\max_k |b_{6,k}|}{\max_k |F_k|}, \qquad \Delta t_{new} = \Delta t \left(\frac{\epsilon}{\tilde{\epsilon}}\right)^{1/7}.\]

A step with \(|\Delta t_{new}/\Delta t|\) below SAFETY_FACTOR is rejected and retried with \(\Delta t_{new}\). Growth is capped at \(\Delta t /\) SAFETY_FACTOR and the step never drops below min_dt.

Parameters:
dtfloat

Time step given in seconds

min_dtfloat

Minimum allowed time step in seconds.

dynamicscallable

Dynamics function describing the equations of motion of the object to be integrated.

n_stateint, optional

The number of rows in the propagated state vector. Defaults to 6.

Attributes:
SAFETY_FACTORfloat

Factor to ensure time steps taken within the integrator are not too small. Default value is 0.25.

EPSILONfloat

Precision parameter of the step-size control, \(\epsilon\) below. Default value is 1e-10.

eventslist[IntegrationEvent]

The IntegrationEvent objects that IAS15 will search for during the integration.

logged_eventslist[(float, list)]

Detected events, saved as a tuple of the form (time, state).

event_tolfloat

Allowable error to consider an event has occured. Default value is 1e-3.

Methods

add_event(event)

Add an event to search for during integration.

integrate(interval, y0)

Perform integration with the propagator.

set_event_tol(tolerance)

Set the event detection tolerance.

References

[1]

H. Rein and D. S. Spiegel, “IAS15: a fast, adaptive, high-order integrator for gravitational dynamics, accurate to machine precision over a billion orbits,” Monthly Notices of the Royal Astronomical Society, vol. 446, no. 2, pp. 1424-1437, 2015. Available: https://doi.org/10.1093/mnras/stu2164

[2]

E. Everhart, “An efficient integrator that uses Gauss-Radau spacings,” in Dynamics of Comets: Their Origin and Evolution, A. Carusi and G. B. Valsecchi, Eds., Reidel, 1985, pp. 185-202.

add_event(event: IntegrationEvent) → None#

Add an event to search for during integration.

Parameters:
eventIntegrationEvent

Event to search for during integration.

integrate(interval: TypeAliasForwardRef('numpy.ndarray') | tuple[float, float], y0: list) → tuple[list[float], list[float]]#

Perform integration with the propagator.

Parameters:
intervalnumpy.ndarray or tuple of two floats

The interval to integrate over. If a numpy.ndarray is given, solve for states at each time within the array. If a tuple of of floats is given, solve for states at times determined by the predictor-corrector along the interval and exactly at the start and end times.

y0list

Initial state vector.

Returns:
tndarray of shape (n_points)

Time points.

yndarray of shape (n, n_points)

Solution states at times t.

set_event_tol(tolerance: float) → None#

Set the event detection tolerance.

Parameters:
tolerancefloat

The new event tolerance.