|
1 |
| -function [Zlist, MergerRateByRedshiftByZ, MergerRateByRedshiftByMtByEta, Mtlist, etalist, SFR, Rdetections, DetectableMergerRate, zlistdetection, x]=... |
| 1 | +function [SFR, Zlist, Mtlist, etalist, FormationRateByRedshiftByZ, FormationRateByRedshiftByMtByEta, ... |
| 2 | + MergerRateByRedshiftByZ, MergerRateByRedshiftByMtByEta, zlistdetection, Rdetections, DetectableMergerRate]=... |
2 | 3 | CosmicHistoryIntegrator(filename, zlistformation, zmaxdetection, Msimulated, makeplots)
|
3 | 4 | % Integrator for the binary black hole merger rate over cosmic history
|
4 | 5 | % COMPAS (Compact Object Mergers: Population Astrophysics and Statistics)
|
5 | 6 | % software package
|
6 | 7 | %
|
7 | 8 | % USAGE:
|
8 |
| -% [Zlist, MergerRateByRedshiftByZ, SFR, Zweight, Rdetections, DetectableMergerRate, Mtzlist, etalist, zlistdetection]=... |
| 9 | +% [SFR, Zlist, Mtlist, etalist, FormationRateByRedshiftByZ, FormationRateByRedshiftByMtByEta, ... |
| 10 | +% MergerRateByRedshiftByZ, MergerRateByRedshiftByMtByEta, zlistdetection, Rdetections, DetectableMergerRate]]=... |
9 | 11 | % CosmicHistoryIntegrator(filename, zlistformation, zmaxdetection, Msimulated [,makeplots])
|
10 | 12 | %
|
11 | 13 | % INPUTS:
|
|
19 | 21 | % makeplots: if set to 1, generates a set of useful plots (default = 0)
|
20 | 22 | %
|
21 | 23 | % OUTPUTS:
|
| 24 | +% SFR is a vector of size length(zlistformation) containing the star formation rate |
| 25 | +% (solar masses per Mpc^3 of comoving volume per year of source time) |
22 | 26 | % Zlist is a vector of metallicities, taken from the COMPAS run input file
|
| 27 | +% Mtlist is a list of total mass bins |
| 28 | +% etalist is a list of symmetric mass ratio bins |
| 29 | +% FormationRateByRedshiftByZ is a matrix of size length(zformationlist) X length(Zlist) |
| 30 | +% which contains a formation rate of merging double compact objects in the given redshift |
| 31 | +% and metallicity bin, in units of formed DCOs per Mpc^3 of comoving volume per |
| 32 | +% year of source time |
| 33 | +% FormationRateByRedshiftByMtByEta is a matrix of size length(zformationlist) |
| 34 | +% X length(Mtlist) X length(etalist) which contains a formation rate of merging double compact objects |
| 35 | +% in the given redshift, total mass and eta bin, in units of formed DCOs per Mpc^3 |
| 36 | +% of comoving volume per year of source time |
23 | 37 | % MergerRateByRedshiftByZ is a matrix of size length(zformationlist) X length(Zlist)
|
24 |
| -% which contains a merger rate of merging compact objects in the given redshift |
| 38 | +% which contains a merger rate of double compact objects in the given redshift |
25 | 39 | % and metallicity bin, in units of mergers per Mpc^3 of comoving volume per
|
26 | 40 | % year of source time
|
27 |
| -% MergerRateByRedshiftByMtByEta is a matrix of size llength(zformationlist) |
28 |
| -% X length(Mtlist) X length(etalist) which contains a merger rate of merging compact objects |
| 41 | +% MergerRateByRedshiftByMtByEta is a matrix of size length(zformationlist) |
| 42 | +% X length(Mtlist) X length(etalist) which contains a merger rate of double compact objects |
29 | 43 | % in the given redshift, total mass and eta bin, in units of mergers per Mpc^3
|
30 | 44 | % of comoving volume per year of source time
|
31 |
| -% Mtlist is a list of total mass bins |
32 |
| -% etalist is a list of symmetric mass ratio bins |
33 |
| -% SFR is a vector of size length(zlistformation) containing the star formation rate |
34 |
| -% (solar masses per Mpc^3 of comoving volume per year of source time) |
| 45 | +% zlistdetection is a vector of redshifts at which detection rates are |
| 46 | +% computed (a subset of zlistformation going up to zmaxdetection) |
35 | 47 | % Rdetection is a matrix of size length(zlistdetection) X length(Mtlist) X
|
36 | 48 | % length(etalist) containing the detection rate per year of observer time
|
37 | 49 | % from a given redshift bin and total mass and symmetric mass ratio pixel
|
38 | 50 | % DetectableMergerRate is a matrix of the same size as Rdetection but
|
39 | 51 | % containing the intrinsic rate of detectable mergers per Mpc^3 of comoving
|
40 | 52 | % volume per year of source time
|
41 |
| -% zlistdetection is a vector of redshifts at which detection rates are |
42 |
| -% computed (a subset of zlistformation going up to zmaxdetection) |
| 53 | + |
43 | 54 | %
|
44 | 55 | % EXAMPLE:
|
45 | 56 | % zlist=0:0.01:10;
|
46 |
| -% [Zlist, MergerRateByRedshiftByZ, MergerRateByRedshiftByMtByEta, Mtlist, etalist, SFR, Rdetections, DetectableMergerRate, zlistdetection,] = ... |
| 57 | +% [SFR, Zlist, Mtlist, etalist, FormationRateByRedshiftByZ, FormationRateByRedshiftByMtByEta, ... |
| 58 | +% MergerRateByRedshiftByZ, MergerRateByRedshiftByMtByEta, zlistdetection, Rdetections, DetectableMergerRate]=... |
47 | 59 | % CosmicHistoryIntegrator('~/Work/COMPASresults/runs/Zdistalpha1-031803.h5', zlist, 1.5, 90e6, 1);
|
| 60 | +% figure(10), semilogy(zlist, sum(MergerRateByRedshiftByZ,2)*1e9,'LineWidth',3), set(gca,'FontSize',20), |
| 61 | +% xlabel('Redshift z'), ylabel('Formation rate of merging DCO per Gpc^3 per yr') |
48 | 62 | %
|
49 | 63 |
|
50 | 64 |
|
|
76 | 90 | dz=zlistformation(2)-zlistformation(1);
|
77 | 91 | etalist=0.01:0.01:0.25;
|
78 | 92 | Mtlist=1:1:ceil(max(M1+M2));
|
| 93 | +FormationRateByRedshiftByZ=zeros(length(zlistformation),length(Zlist)); |
| 94 | +FormationRateByRedshiftByMtByEta=zeros(length(zlistformation),length(Mtlist),length(etalist)); |
79 | 95 | MergerRateByRedshiftByZ=zeros(length(zlistformation),length(Zlist));
|
80 | 96 | MergerRateByRedshiftByMtByEta=zeros(length(zlistformation),length(Mtlist),length(etalist));
|
81 | 97 | x=zeros(size(M1));
|
82 | 98 | for(i=1:length(M1)),
|
83 | 99 | Zcounter=find(Zlist>=Z(i),1);
|
84 | 100 | eta=M1(i)*M2(i)/(M1(i)+M2(i))^2;
|
85 | 101 | etaindex=ceil(eta*100);
|
| 102 | + Mtindex=ceil(M1(i)+M2(i)); |
| 103 | + FormationRateByRedshiftByZ(:,Zcounter)=transpose(SFR).*Zweight(:,Zcounter)/Msimulated; |
| 104 | + FormationRateByRedshiftByMtByEta(:,Mtindex,etaindex)=transpose(SFR).*Zweight(:,Zcounter)/Msimulated; |
86 | 105 | tLform=tL+Tdelay(i); %lookback time of when binary would have to form in order to merge at lookback time tL
|
87 | 106 | firsttooearlyindex=find((tLform)>max(tL),1);
|
88 | 107 | if(isempty(firsttooearlyindex)), firsttooearlyindex=length(tL)+1; end;
|
89 | 108 | zForm=interp1(tL,zlistformation,tLform(1:firsttooearlyindex-1));
|
90 | 109 | zFormindex=ceil((zForm-zlistformation(1))./dz)+1;
|
91 |
| - Mtindex=ceil(M1(i)+M2(i)); |
92 | 110 | if(~isempty(zFormindex))
|
93 | 111 | x(i)=SFR(zFormindex(1))*Zweight(zFormindex(1),Zcounter)/Msimulated;
|
94 | 112 | MergerRateByRedshiftByZ(1:firsttooearlyindex-1,Zcounter)=...
|
|
98 | 116 | MergerRateByRedshiftByMtByEta(1:firsttooearlyindex-1,Mtindex,etaindex) + ...
|
99 | 117 | transpose(SFR(zFormindex)).*Zweight(zFormindex,Zcounter)/Msimulated;
|
100 | 118 | end;
|
101 |
| - %for(k=1:length(zlistformation)), %merger redshift index |
102 |
| - % if((Tdelay(i)+tL(k)) > max(tL)), continue; end; %binary can't merge this early |
103 |
| - % zformindex=find(tL>=(Tdelay(i)+tL(k)),1); |
104 |
| - % Mtzindex=ceil((M1(i)+M2(i))*(1+zlistformation(k))); |
105 |
| - % MergerRateByRedshiftByZ(k,Zcounter)=... |
106 |
| - % MergerRateByRedshiftByZ(k,Zcounter)+... |
107 |
| - % SFR(zformindex)*Zweight(zformindex,Zcounter)/Msimulated; |
108 |
| - % MergerRateByRedshiftByMtzByEta(k,Mtzindex,etaindex) =... |
109 |
| - % MergerRateByRedshiftByMtzByEta(k,Mtzindex,etaindex) + ... |
110 |
| - % SFR(zformindex)*Zweight(zformindex,Zcounter)/Msimulated; |
111 |
| - %end; |
112 | 119 | end;
|
113 | 120 |
|
114 | 121 | zlistdetection=zlistformation(1:find(zlistformation<=zmaxdetection,1,"last"));
|
|
0 commit comments