IASNN Arb-Prec#

An experimental/testing module for testing the DoubleDouble integrator stuff.

This implements arbitrary-order IAS15-style integrators using the mpmath library. It’s about as anti-JAX as you can get, but it’s useful for testing the DoubleDouble operations.

jorbit.integrators.iasnn_arbitrary_prec.acceleration_func(x)[source]#

A dummy acceleration function for testing purposes, unit central potential.

Parameters:

x (matrix) – (n_particles, 3) array of positions

Returns:

(n_particles, 3) array of accelerations

Return type:

matrix

jorbit.integrators.iasnn_arbitrary_prec.estimate_x_v_from_b(a0, v0, x0, dt, b_x_denoms, b_v_denoms, h, bp)[source]#

Same as the estimate_x_v_from_b in the DoubleDouble integrator, but using mpmath.

Return type:

tuple

Parameters:
  • a0 (mpmath.matrices.matrices.matrix)

  • v0 (mpmath.matrices.matrices.matrix)

  • x0 (mpmath.matrices.matrices.matrix)

  • dt (mpmath.matrices.matrices.matrix)

  • b_x_denoms (mpmath.matrices.matrices.matrix)

  • b_v_denoms (mpmath.matrices.matrices.matrix)

  • h (mpmath.matrices.matrices.matrix)

  • bp (mpmath.matrices.matrices.matrix)

jorbit.integrators.iasnn_arbitrary_prec.precompute(n_internal_points)[source]#

Precompute the constants needed for an arbitrary-order IASNN-style integrator.

This creates the H, C, R, D arrays you see in the REBOUND source, and some precomputed denominators for the Taylor expansion coefficients.

Parameters:

n_internal_points (int) – The number of internal evaluations to use when estimating the acceleration across a given step. IAS15 uses 7.

Returns:

b_x_denoms (mpm.matrix):

The denominators for the Taylor expansion of the position.

b_v_denoms (mpm.matrix):

The denominators for the Taylor expansion of the velocity.

h (mpm.matrix):

The H array from REBOUND, a list of the roots of the Chebyshev polynomial.

r (mpm.matrix):

The R array from REBOUND, a list of the coefficients for the Taylor expansion of the acceleration.

c (mpm.matrix):

The C array from REBOUND, a list of the coefficients for the Taylor expansion of the acceleration.

d (mpm.matrix):

The D array from REBOUND, a matrix of coefficients for the Taylor expansion of the acceleration.

Return type:

tuple

jorbit.integrators.iasnn_arbitrary_prec.refine_b_and_g(r, c, b, g, at, a0, substep_num, return_g_diff)[source]#

Same as the refine_b_and_g in the DoubleDouble integrator, but using mpmath.

Return type:

tuple

Parameters:
  • r (mpmath.matrices.matrices.matrix)

  • c (mpmath.matrices.matrices.matrix)

  • b (mpmath.matrices.matrices.matrix)

  • g (mpmath.matrices.matrices.matrix)

  • at (mpmath.matrices.matrices.matrix)

  • a0 (mpmath.matrices.matrices.matrix)

  • substep_num (int)

  • return_g_diff (bool)

jorbit.integrators.iasnn_arbitrary_prec.refine_intermediate_g(substep_num, g, r, at, a0)[source]#

Same as the refine_intermediate_g in the DoubleDouble integrator, but using mpmath.

Return type:

matrix

Parameters:
  • substep_num (int)

  • g (mpmath.matrices.matrices.matrix)

  • r (mpmath.matrices.matrices.matrix)

  • at (mpmath.matrices.matrices.matrix)

  • a0 (mpmath.matrices.matrices.matrix)

jorbit.integrators.iasnn_arbitrary_prec.step(x0, v0, b, dt, precomputed_setup, verbose=False, convergence_threshold=mpf('9.999999999999999999999999999999999999999999999999999999999999999999999993e-41'))[source]#

Same as the step in the DoubleDouble integrator, but using mpmath.

Return type:

tuple

Parameters:
  • x0 (mpmath.matrices.matrices.matrix)

  • v0 (mpmath.matrices.matrices.matrix)

  • b (mpmath.matrices.matrices.matrix)

  • dt (mpmath.matrices.matrices.matrix)

  • precomputed_setup (tuple)

  • verbose (bool)

  • convergence_threshold (mpmath.ctx_mp_python.mpf)