pint.derived_quantities.companion_mass

pint.derived_quantities.companion_mass(pb: Unit("d"), x: Unit("cm"), i=<Quantity 60. deg>, mp=<Quantity 1.4 solMass>)[source]

Commpute the companion mass from the orbital parameters

Compute companion mass for a binary system from orbital mechanics, not Shapiro delay. Can handle scalar or array inputs.

Parameters:
Returns:

mass – In u.solMass

Return type:

astropy.units.Quantity

Raises:

Example

>>> import pint
>>> import pint.derived_quantities
>>> from astropy import units as u
>>> print(pint.derived_quantities.companion_mass(1*u.d, 2*pint.ls, inc=30*u.deg, mpsr=1.3*u.Msun))
0.6363138973397279 solMass

Notes

This ends up as a a cubic equation of the form: \(a M_c^3 + b M_c^2 + c M_c + d = 0\)

  • \(a = \sin^3(inc)\)

  • \(b = -{\rm massfunct}\)

  • \(c = -2 M_p {\rm massfunct}\)

  • \(d = -{\rm massfunct} M_p^2\)

To solve it we can use a direct calculation of the cubic roots [3].

It’s useful to look at the discriminant to understand the nature of the roots and make sure we get the right one [4].

\(\Delta = (b^2 c^2 - 4ac^3-4b^3d-27a^2d^2+18abcd)\)

if \(\delta< 0\) then there is only 1 real root, and I think we do it correctly below and this should be < 0 since this reduces to \(-27\sin^6 i f(P_b,x)^2 M_p^4 -4\sin^3 i f(P_b,x)^3 M_p^3\) (where \(f(P_b,x)\) is the mass function) so there is just 1 real root.