In [7]:
import binary_tools
from binary_tools.utils.orbits import*
from binary_tools.utils.kicks import*

Orbits

This file contains small functions that are used repeatedly thoughout larger blocks of code. The first is an angular momentum calculator, using the equation

$$J_{\rm orb} = M_1 M\odot M_2 M\odot \sqrt{G A R\odot (1-e^2)/((M_1+M_2)M\odot)}$$

where $J_{\rm orb}$ is the angular momentum, M_1 and M_2 are the masses of a binary system in solar masses, A is the semi-major axis, $M\odot$ is the mass of the sun, $R\odot$ is the radius of the sun, and G is the gravitational constant


In [8]:
sample_e = 0.2

In [9]:
true_anomaly = rand_true_anomaly(sample_e)

In [10]:
angular_momentum(133,5.5,55,sample_e)


Out[10]:
2.6572192836451168e+54

The second function is used to calculate the separation between two mass given the semi-major axis, the eccentricity, and the true anomaly. The following equation was used

$$separation = \frac{A(1 - e^2)} {1+e\cos(u)}$$

where A is the semi-major axis and u is the true anomaly


In [11]:
separation_function(133,sample_e,true_anomaly)


Out[11]:
128.49409397358406