Generate Coefficients#
Generate the high-precision coefficients for IAS15-style integrators.
- jorbit.utils.generate_coefficients.create_gauss_radau_spacings(internal_points)[source]#
Compute the spacings for the Gauss-Radau quadrature rule for an arbitrary number of internal points.
IAS15 uses 7 internal points, which results in a 15th order integrator. If we wanted a higher or lower order integrator, we could change the number of internal points. But, then we need to know where to actually evaluate those points: this function uses the mpmath library to compute those locations, which are the roots of the Legendre polynomial of order n-1 and n, divided by x+1.
Confirmed that the resulting values match those tabulated in Table 12 of Stroud and Secrest 1966.
- Parameters:
internal_points (
int) – The number of internal points to use.- Returns:
The spacings for the Gauss-Radau quadrature rule. The ‘H’ array in IAS15.
- Return type:
list[mpf]
- jorbit.utils.generate_coefficients.create_iasnn_c_d_arrays(h)[source]#
Create the equivalent of the ‘C’ and ‘D’ arrays in IAS15 for an arbitrary-order integrator.
- Parameters:
h (
list[mpf]) – The spacings for the Gauss-Radau quadrature rule.- Returns:
The ‘C’ and ‘D’ arrays for the integrator.
- Return type:
tuple[list[mpf],list[mpf]]
- jorbit.utils.generate_coefficients.create_iasnn_constants(n_internal_points)[source]#
Create the equivalent of the ‘H’, ‘R’, ‘C’, and ‘D’ arrays in IAS15 for an arbitrary-order integrator.
Just a wrapper around create_gauss_radau_spacings, create_iasnn_r_array, and create_iasnn_c_d_arrays.
- Parameters:
n_internal_points (
int) – The number of internal points to use.- Returns:
The ‘H’, ‘R’, ‘C’, and ‘D’ arrays for the integrator.
- Return type:
tuple[list[mpf],list[mpf],list[mpf],list[mpf]]