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:
In [1]: from cosmic.sample.initialbinarytable import InitialBinaryTable
In [2]: from cosmic.evolve import Evolve
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 [3]: n_grid = 10
In [4]: 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 [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0,
...: 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000,
...: 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5,
...: 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0,
...: 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0,
...: 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]],
...: 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90,
...: '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],
...: 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25,
...: 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0,
...: '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],
...: 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1,
...: 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1,
...: 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0,
...: 'wd_mass_lim': 1}
...:
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.561836 74.433283 67.900444 ... 0.0 0.0 0
0 3.563725 74.195874 67.901480 ... 0.0 0.0 0
0 3.564957 73.978352 67.965270 ... 0.0 0.0 0
0 3.656147 34.358643 98.037335 ... 0.0 0.0 0
.. ... ... ... ... ... ... ...
9 3.930319 28.153730 35.520384 ... 0.0 0.0 9
9 3.960762 28.159153 31.484483 ... 0.0 0.0 9
9 4.100892 28.159153 24.732495 ... 0.0 0.0 9
9 4.100892 28.159153 24.232495 ... 0.0 0.0 9
9 13700.000000 28.159153 24.232495 ... 0.0 0.0 9
[135 rows x 44 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
1 0.0 1 100.000000 ... 0 -001 1
2 0.0 1 100.000000 ... 0 -001 2
2 13700.0 14 25.319576 ... 0 -001 2
3 0.0 1 100.000000 ... 0 -001 3
3 13700.0 14 27.066154 ... 0 -001 3
4 0.0 1 100.000000 ... 0 -001 4
4 13700.0 14 24.672076 ... 0 -001 4
5 0.0 1 100.000000 ... 0 -001 5
5 13700.0 14 29.517261 ... 0 -001 5
6 0.0 1 100.000000 ... 0 -001 6
6 13700.0 14 28.990549 ... 0 -001 6
7 0.0 1 100.000000 ... 0 -001 7
7 13700.0 14 28.809440 ... 0 -001 7
8 0.0 1 100.000000 ... 0 -001 8
8 13700.0 14 28.708663 ... 0 -001 8
9 0.0 1 100.000000 ... 0 -001 9
9 13700.0 14 28.653730 ... 0 -001 9
[18 rows x 39 columns]