API documentation#

class spindler.solver.Solver#

Abstract class defining the common methods to access the derivatives of the binary parameters and means to compute their evolution.

evolve(accreted_mass: float, q0: float, e0: float, method: str = 'LSODA', rtol: float = 0.01, atol: float = 1e-05, **kwargs) tuple[ArrayLike, ArrayLike, ArrayLike, ArrayLike]#

Compute the evolution of the binary system

Parameters:
  • accreted_mass (float) – mass accreted to the binary, in units of initial binary mass m0.

  • q0 (float) – initial mass ratio

  • e0 (float) – initial eccentricity

  • method (str, optional) – integration method. See scipy solve_ivp documentation. Defaults to ‘LSODA’.

  • rtol (float, optional) – relative tolerance. Defaults to 1e-2.

  • atol (float, optional) – absolute tolerane. Defaults to 1e-5.

  • **kwargs – keywords arguments passed to solve_ivp

Returns:

semimajor axis q (ArrayLike): mass ratio e (ArrayLike): eccentricity m (ArrayLike): mass of the binary

Return type:

a (ArrayLike)

get_DE(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the orbital energy E with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dlogE/dlogm

Return type:

ArrayLike

get_DJ(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes derivative of the orbital angular momentum J with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dlogJ/dlogm

Return type:

ArrayLike

get_Da(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the semimajor axis a with respect to the mass of the binary m. This function is implemented in the child classes.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dloga/dlogm

Return type:

ArrayLike

get_De(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the eccentricity e with respect to the mass of the binary m. This function is implemented in the child classes.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dloge/dlogm

Return type:

ArrayLike

get_Dq(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the mass ratio e with respect to the mass of the binary m. This function is implemented in the child classes.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dlogq/dlogm

Return type:

ArrayLike

class spindler.solver.Solver_DD21(print_warnings=False)#

Circumbinary disk model based on the simulations in D’Orazio and Duffell 2021 (2021ApJ…914L..21D)

It is defined for eccentricity between 0 and 0.8, and mass ratio equal to 1.

get_Da(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the semimajor axis a with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio. Ignored, but if different from 1 generates a warning.

  • e (ArrayLike) – eccentricity

Returns:

dloga/dlogm

Return type:

ArrayLike

get_De(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the eccentricity e with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio. Ignored, but if different from 1 generates a warning.

  • e (ArrayLike) – eccentricity

Returns:

dloge/dlogm

Return type:

ArrayLike

get_Dq(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the mass ratio e with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio. Ignored, but if different from 1 generates a warning.

  • e (ArrayLike) – eccentricity

Returns:

dlogq/dlogm

Return type:

ArrayLike

class spindler.solver.Solver_Siwek23#

Circumbinary disk model based on the simulations in Siwek et al. 2023 (2023MNRAS.518.5059S) Siwek et al. 2023 (2023MNRAS.522.2707S)

It is defined for eccentricity between 0 and 0.8, and mass ratio between 0.1 and 1.

get_Da(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the semimajor axis a with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dloga/dlogm

Return type:

ArrayLike

get_De(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the eccentricity e with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dloge/dlogm

Return type:

ArrayLike

get_Dq(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the mass ratio e with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio

  • e (ArrayLike) – eccentricity

Returns:

dlogq/dlogm

Return type:

ArrayLike

class spindler.solver.Solver_Zrake21(print_warnings=False)#

Circumbinary disk model based on the simulations in Zrake et al. 2021 (2021ApJ…909L..13Z)

It is defined for eccentricity between 0 and 0.8, and mass ratio equal to 1.

get_Da(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the semimajor axis a with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio. Ignored, but if different from 1 generates a warning.

  • e (ArrayLike) – eccentricity

Returns:

dloga/dlogm

Return type:

ArrayLike

get_De(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the eccentricity e with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio. Ignored, but if different from 1 generates a warning.

  • e (ArrayLike) – eccentricity

Returns:

dloge/dlogm

Return type:

ArrayLike

get_Dq(q: ArrayLike, e: ArrayLike) ArrayLike#

Computes the derivative of the mass ratio e with respect to the mass of the binary m.

Parameters:
  • q (ArrayLike) – mass ratio. Ignored, but if different from 1 generates a warning.

  • e (ArrayLike) – eccentricity

Returns:

dlogq/dlogm

Return type:

ArrayLike

class spindler.interpolator.RegularGridInterpolatorNNextrapol(points, values, method='linear')#

A regular grid interpolator that uses the value of the nearest point when called outside of its bounds.