binaries
is a set of Python notebooks to calculate the evolution of wide stellar binaries as one or both of the component stars lose mass and / or undergo an associated velocity kick on their way to becoming white dwarfs. The code was written by Nadia Zakamska. This code is written for Python 3, and it depends on a handful of standard mathematical and plotting packages. If you use binaries
in your research, please cite Zakamska and Hwang 2024 (in prep., will be updated as soon as available).
The file orbital.py
is the necessary set of helper functions used throughout the notebooks, such as conversions of different anomalies to one another and conversions between Cartesian and orbital elements. It should be put in the same directory as the notebooks (the top section of the notebooks contains the import statement for this file). The file orbital_tests.py
shows usage of some of the functions in orbital.py
.
The file ancillary.py
contains helper functions for calculating the integrals described in the appendix. It uses mcint
by Tristant Snowsill which was originally taken from https://pypi.org/project/mcint/, but had to be adapted for Python 3 and is provided here for ease. ancillary.py
is not strictly speaking necessary for most of the results in the paper, but in order for all the notebooks to run smoothly both ancillary.py
and mcint.py
should be put in the same directory as the notebooks.
public_testing_hamiltonian.ipynb
notebook presents tests of our secular evolution equations. We test against analystical solutions and direct numerical integration of orbits using rebound
available at https://rebound.readthedocs.io/en/latest/. rebound
does not cover the full scientifically interesting case of both mass loss and acceleration, so we can only test our equations in the regime of constant mass.
public_testing_integrators.ipynb
notebook presents tests of our orbital integrators. We have three methods of directly integrating the orbital evolution for mass loss + kick: (1) leapfrog integrator; (2) representing the kick and mass loss as a series of smaller episodes spread over time, with analytical steps in between; and (3) a built-in SciPy integrator. We start by testing these three methods against rebound
in the case of constant acceleration and non-varying mass. Then we test the three methods against each other for several orbital configurations. We retain leapfrog integrator and the kick function, but discard the built-in SciPy integrator.
public_model_setup.ipynb
notebook sets up the population synthesis model and examines the main-sequence binary fraction, for which the orbital evolution does not need to be taken into account (the only evolutionary effects taken into account for the main sequence binary fraction are whether any of the components of the initial binaries or the initial singles are still on the main sequence; otherwise, neither the periods nor the eccentricities of the binaries evolve compared to the birth setup).
public_evolution.ipynb
notebook evolves the first million binaries generated by public_model_setup.ipynb
through the first step of the mass loss, if and when the more massive of the two stars evolves into the white dwarf by the present day. The method of calculation is determined on the basis of the ratio of the evolutionary lifetime and orbital timescale. public_evolution_step2.ipynb
calculates the orbital evolution due to the 2nd episode of mass loss for the WD-WD binaries.
public_statistics.ipynb
notebook shows some key plots such as the WD-MS wide binary fraction as a function of mass, WD-WD wide binary fraction as a function of mass, and WD-MS wide binary fraction as a function of age, as well as the retention fraction, and compares them to the observed trends. The observed trends are shown in the Jupyter notebooks, but for running the notebooks locally these commands should be skipped or commented out, since the distribution does not include these figures.