Evolving a fixed grid of binaries

Sometimes it is helpful to run a fixed grid of initial binaries to explore how changing a single parameter affects the evolved binary. Let’s start by importing the necessary modules and setting up the BSEDict settings as we’ve done in the previous examples.

In [1]: from cosmic.sample.initialbinarytable import InitialBinaryTable

In [2]: from cosmic.evolve import Evolve
In [3]: BSEDict = {
   ...:     "pts1": 0.001, "pts2": 0.01, "pts3": 0.02, "zsun": 0.014, "windflag": 3,
   ...:     "eddlimflag": 0, "neta": 0.5, "bwind": 0.0, "hewind": 0.5, "beta": 0.125,
   ...:     "xi": 0.5, "acc2": 1.5, "alpha1": 1.0, "lambdaf": 0.0, "ceflag": 1,
   ...:     "cekickflag": 2, "cemergeflag": 1, "cehestarflag": 0, "qcflag": 5,
   ...:     "qcrit_array": [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
   ...:     "kickflag": 5, "sigma": 265.0, "bhflag": 1, "bhsigmafrac": 1.0,
   ...:     "sigmadiv": -20.0, "ecsn": 2.25, "ecsn_mlow": 1.6, "aic": 1, "ussn": 1,
   ...:     "pisn": -2, "polar_kick_angle": 90.0,
   ...:     "natal_kick_array": [[-100.0, -100.0, -100.0, -100.0, 0.0], [-100.0, -100.0, -100.0, -100.0, 0.0]],
   ...:     "mm_mu_ns": 400.0, "mm_mu_bh": 200.0, "remnantflag": 4, "mxns": 3.0,
   ...:     "rembar_massloss": 0.5, "wd_mass_lim": 1, "maltsev_mode": 0,
   ...:     "maltsev_fallback": 0.5, "maltsev_pf_prob": 0.1, "bhspinflag": 0,
   ...:     "bhspinmag": 0.0, "grflag": 1, "eddfac": 10, "gamma": -2, "don_lim": -1,
   ...:     "acc_lim": -1, "tflag": 1, "ST_tide": 1,
   ...:     "fprimc_array": [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0],
   ...:     "ifflag": 1, "wdflag": 1, "epsnov": 0.001, "bdecayfac": 1,
   ...:     "bconst": 3000, "ck": 1000, "rejuv_fac": 1.0, "rejuvflag": 0,
   ...:     "bhms_coll_flag": 0, "htpmb": 1, "ST_cr": 1, "rtmsflag": 0
   ...: }
   ...: 

Here we evolve the same system that produces a GW150914-like binary, but run over several initial orbital periods spaced evenly in log space.

In [4]: n_grid = 10

In [5]: binary_grid = InitialBinaryTable.InitialBinaries(
   ...:     m1=np.ones(n_grid)*100.0,
   ...:     m2=np.ones(n_grid)*85.0,
   ...:     porb=np.logspace(3,5,n_grid),
   ...:     ecc=np.ones(n_grid)*0.65,
   ...:     tphysf=np.ones(n_grid)*13700.0,
   ...:     kstar1=np.ones(n_grid),
   ...:     kstar2=np.ones(n_grid),
   ...:     metallicity=np.ones(n_grid)*0.005
   ...: )
   ...: 

In [6]: print(binary_grid)
   kstar_1  kstar_2  mass_1  mass_2  ...  bhspin_1  bhspin_2  tphys  binfrac
0      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
1      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
2      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
3      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
4      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
5      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
6      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
7      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
8      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0
9      1.0      1.0   100.0    85.0  ...       0.0       0.0    0.0      1.0

[10 rows x 38 columns]

In [7]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_grid, BSEDict=BSEDict)

In [8]: print(bpp)
           tphys      mass_1     mass_2  ...  bhspin_1  bhspin_2  bin_num
0       0.000000  100.000000  85.000000  ...       0.0       0.0        0
0       3.561768   74.448784  67.928686  ...       0.0       0.0        0
0       3.563654   74.211763  67.929727  ...       0.0       0.0        0
0       3.564469   74.083399  67.956528  ...       0.0       0.0        0
0       3.564469   74.083399  67.956528  ...       0.0       0.0        0
..           ...         ...        ...  ...       ...       ...      ...
9       3.930319   28.153852  35.520424  ...       0.0       0.0        9
9       3.960761   28.159285  31.484518  ...       0.0       0.0        9
9       4.100891   28.159285  24.732496  ...       0.0       0.0        9
9       4.100891   28.159285  24.232496  ...       0.0       0.0        9
9   13700.000000   28.159285  24.232496  ...       0.0       0.0        9

[126 rows x 46 columns]

In [9]: print(bcm)
     tphys  kstar_1     mass0_1  ...  bin_state  merger_type  bin_num
0      0.0        1  100.000000  ...          0         -001        0
0  13700.0       15  120.507759  ...          1         0201        0
1      0.0        1  100.000000  ...          0         -001        1
1  13700.0       14   52.902779  ...          1         0201        1
2      0.0        1  100.000000  ...          0         -001        2
2  13700.0       15   22.991878  ...          1         0214        2
3      0.0        1  100.000000  ...          0         -001        3
3  13700.0       14   27.032271  ...          0         -001        3
4      0.0        1  100.000000  ...          0         -001        4
4  13700.0       14   24.728769  ...          0         -001        4
5      0.0        1  100.000000  ...          0         -001        5
5  13700.0       14   29.522291  ...          0         -001        5
6      0.0        1  100.000000  ...          0         -001        6
6  13700.0       14   28.991674  ...          0         -001        6
7      0.0        1  100.000000  ...          0         -001        7
7  13700.0       14   28.809948  ...          0         -001        7
8      0.0        1  100.000000  ...          0         -001        8
8  13700.0       14   28.708909  ...          0         -001        8
9      0.0        1  100.000000  ...          0         -001        9
9  13700.0       14   28.653852  ...          0         -001        9

[20 rows x 41 columns]