LALSimulation  5.4.0.1-fe68b98
LALSimIMRSEOBNRv4ROM_NSBHAmplitudeCorrection.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Andrew Matas
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with with program; see the file COPYING. If not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19 
20 #ifdef __GNUC__
21 #define UNUSED __attribute__ ((unused))
22 #else
23 #define UNUSED
24 #endif
25 
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <math.h>
29 #include <complex.h>
30 
31 #include <lal/LALStdlib.h>
32 #include <lal/Units.h>
33 #include <lal/LALConstants.h>
34 #include <lal/LALSimIMR.h>
35 
37 
38 /**
39  * Tanh window function
40  * w^{+/-}_{f0,sigma}(f) = 0.5 * (1 +/- tanh(4*(f-f0)/sigma))
41  * Auxiliary function used by SEOBNRv4_ROM_NRTidalv2_NSBH.
42  */
44  const REAL8 f, /**< frequency at which to evaluate window function */
45  const int sign, /**< sign (+1 or -1), used to determine whether window is "on" or "off"*/
46  const REAL8 f0, /**< central frequency of window function */
47  const REAL8 sigma) /**< width of window function */
48 {
49  REAL8 window;
50  REAL8 x;
51  x=4*(f-f0)/sigma;
52  window =0.5 * (1+sign*tanh(x));
53  return window;
54 }
55 
56 
57 /**
58  * Returns ringdown frequency in units of the total mass using
59  * fits from gr-qc/0512160/. Auxiliary function used by SEOBNRv4_ROM_NRTidalv2_NSBH.
60  */
62  REAL8 MF, /**< Final mass (in solar masses) */
63  REAL8 chiF, /**< Final spin (dimensionless */
64  REAL8 Mtot) /**< Iniital toal mass (in solar masses */
65 {
66  REAL8 k1=1.5251;
67  REAL8 k2=-1.1568;
68  REAL8 k3=0.1292;
69  REAL8 fRD=1/(2*LAL_PI) * (k1+k2*pow(1-chiF,k3)) * Mtot/MF;
70  return fRD;
71 }
72 
73 /**
74  * @addtogroup LALSimIMRTIDAL_c
75  *
76  * @{
77  *
78  * @name SEOBNRv4_ROM_NRTidalv2_NSBH
79  *
80  * @author Andrew Matas
81  *
82  * @brief C code for SEOBNRv4_ROM_NRTidalv2_NSBH model. A technical note deescribing the model can be found at https://dcc.ligo.org/LIGO-T1900723.
83  *
84  * SEOBNRv4_ROM_NRTidalv2_NSBH is a frequency domain model that applies amplitude corrections due to tidal disruption to the SEOBNRv4ROM model. It is based on the SEOBNRv4_ROM_NRTidalv2.
85  *
86  * @note Parameter ranges:
87  * * 1 <= q = m1/m2 <= 100
88  * * m2 <= 3 Msun
89  * * lambda1 = 0
90  * * 0 <= lambda2 <= 5000
91  * mi = mass of object i, lambdai = tidal parameter of object i (i={1,2}). i=1 is the black hole, i=2 is the neutron star. The model was compared with NR simulations with BH spin magnitudes up to 0.9.
92  *
93  * @note A warning is issued when
94  * * chi2 is not 0 (model was fit to NR simulations with chi2=0, but checked against existing simulations with chi2=-0.2)
95  * * m1 < 1 Msun
96  *
97  * chi2 = neutron star spin
98  *
99  * @review SEOBNRv4_ROM_NRTidalv2_NSBH review by Frank Ohme, Tim Dietrich, Shrobana Ghosh,
100  * Andrew Matas, Jonathan Thompson, Edward Fauchon-Jones. The review concluded
101  * on 3 February 2020. The review documentation, resources, and final git hash
102  * can be found at https://git.ligo.org/waveforms/reviews/nsbh-models/wikis/home.
103  *
104  * @{
105  */
106 
107  /**
108  * Compute amplitude correction to SEOBNRv4_ROM_NRTidalv2 in LAL format at specified
109  * frequencies for the SEOBNRv4_ROM_NRTidalv2_NSBH model, incorporating tidal disruption
110  * effects.
111  *
112  * XLALSEOBNRv4ROMNSBHAmplitudeCorrectionFrequencySeries returns a frequency series with
113  * real numbers between 0 and 1, which corrects the amplitude of SEOBNRv4_ROM_NRTidalv2.
114  *
115  */
117  const REAL8Sequence *amp_tidal, /**< [out] tidal amplitude frequency series */
118  const REAL8Sequence *fHz, /**< list of input Gravitational wave Frequency in Hz to evaluate */
119  REAL8 m1_SI, /**< Mass of companion 1 (kg) */
120  REAL8 m2_SI, /**< Mass of companion 2 (kg) */
121  REAL8 chi1, /**< Spin of black hole */
122  REAL8 lambda2 /**< (tidal deformability of mass 2) / m2^5 (dimensionless) */
123 ) {
124 
125  // Change masses to natural units
126  REAL8 MBH = m1_SI / LAL_MSUN_SI;
127  REAL8 MNS = m2_SI / LAL_MSUN_SI;
128 
129  // Derive useful quantities used later
130 
131  // Properties of progenitor
132  REAL8 Mtot=MBH+MNS;
133  REAL8 MtotSI=m1_SI+m2_SI; // Total mass
134  REAL8 fmtotSI=pow(LAL_C_SI,3) / ( LAL_G_SI * MtotSI ); // frequency for total mass
135  REAL8 nu = (MBH*MNS)/pow(MBH+MNS,2); // symmetric mass rtio
136  REAL8 Q=MBH/MNS;
138  REAL8 RNS=MNS/CNS; // NS radius
139 
140  // Properties of remnant
141  REAL8 MF=XLALBHNS_mass_aligned(MBH, MNS, chi1, lambda2); // final mass of remnant
142  REAL8 chiF=XLALBHNS_spin_aligned(MBH, MNS, chi1, lambda2); // final spin of remnant
143  REAL8 fRD=CalcRDFrequency(MF,chiF,Mtot); // ringdown frequency of remant in units of total mass
144 
145 
146  // Mass shedding
147  REAL8 xiTide=XLALSimNSBH_xi_tide(Q,chi1,MBH/RNS); // Relativistic correction to mass shedding
148  REAL8 ZERO = 1e-15; // to prevent tidal frequency from going to infinity in BH limit
149  REAL8 RTidal=xiTide*RNS*(1-2*CNS) + ZERO;
150  REAL8 fTidal=XLALSimNSBH_fGWinKerr(RTidal,MF,chiF) * Mtot;
151  REAL8 MbTorus=XLALSimNSBH_torus_mass_fit(Q, chi1, CNS);
152 
153  fTidal=fabs(fTidal);
154 
155  // Construct correction functions
156 
157  // Compute non-disrupitve correction
158  // parameters determined by fit to NR data
159  REAL8 x1=-0.09236597801342522;
160  REAL8 x2=-0.1773927624795226;
161  REAL8 xND_C=-0.4865330927898738;
162  REAL8 xND_chi=-0.03143937714260868;
163  REAL8 xNDprime_C=0.4933764101669873;
164  REAL8 xNDprime_chi=0.05691547067814197;
165  REAL8 d1=0.01871545791809104;
166  REAL8 d2=0.771909557448921;
167  REAL8 dND=0.022500562246265655;
168 
169  REAL8 fratio=(fTidal-fRD)/fRD;
170  REAL8 xND=pow(fratio,2)+xND_C*CNS+xND_chi*chi1;
171  REAL8 xNDprime=pow(fratio,2)+xNDprime_C*CNS+xNDprime_chi*chi1;
172  REAL8 eTide=TanhWindow(xND,+1,x1,d1);
173  REAL8 sigma_tide=2*TanhWindow(xNDprime,-1,x2,d2);
174 
175  REAL8 f0_ND=fRD;
176  REAL8 sigma_ND=dND+sigma_tide;
177 
178  // Compute and apply disrupitve correction
179  // parameters determined by fit to NR data
180  REAL8 a1=1.2728043573489636;
181  REAL8 a2=0.1853261083544252;
182  REAL8 b1=-1.6873457237092873;
183  REAL8 b2=-0.25347578534406;
184  REAL8 xD_C=0.8496732940251721;
185  REAL8 xD_nu=0.3022694700157108;
186  REAL8 xDprime_C=-0.9904717980366731;
187  REAL8 xDprime_nu=1.1227719410457802;
188  REAL8 xD_chi=-0.16594256718148745;
189  REAL8 xDprime_chi1=0.002986871614045452;
190  REAL8 xDprime_chi2=-0.07136411471590108;
191  REAL8 xDprime_chi3=-0.11261503453409044;
192 
193 
194  REAL8 xD=MbTorus + xD_C*CNS + xD_nu*pow(nu,0.5) + xD_chi*chi1;
195  REAL8 xDprime=MbTorus + xDprime_C*CNS + xDprime_nu*pow(nu,0.5)
196  + xDprime_chi1*chi1 + xDprime_chi2*pow(chi1,2)
197  + xDprime_chi3*pow(chi1,3);
198 
199  REAL8 eins=a1+b1*xD;
200  REAL8 sigma_tide2=a2+b2*xDprime;
201 
202  REAL8 f0_D=eins*fTidal;
203  REAL8 sigma_D=sigma_tide2;
204 
205 
206  REAL8 f0=0;
207  REAL8 sigma=0;
208  REAL8 eRD=0;
209  if (fTidal>=fRD && MbTorus==0){ // Case 1 (non-disruptive)
210  f0=f0_ND;
211  sigma=sigma_ND;
212  eRD=eTide;
213  }
214  else if (fTidal<fRD && MbTorus>0){ // Case 2 (disruptive)
215  f0=f0_D;
216  sigma=sigma_D;
217  eRD=0;
218  }
219  else if (fTidal<fRD && MbTorus==0){ // Case 3 (mildly disruptive without remnant torus)
220  f0 = (1-pow(Q,-1))*f0_ND + pow(Q,-1)*f0_D;
221  sigma=0.5*(sigma_ND+sigma_D);
222  eRD=0;
223  }
224  else if (fTidal>=fRD && MbTorus>0){ // Case 4 (mildly disruptive with remnant torus)
225  f0 = eins*fRD;
226  sigma=sigma_ND;
227  eRD=eTide;
228  }
229 
230 
231  // Apply window corrections
232  for (UINT8 ii=0;ii<(*fHz).length;ii++){
233  (*amp_tidal).data[ii] = TanhWindow((*fHz).data[ii]/fmtotSI,-1,f0,sigma)
234  + eRD*TanhWindow((*fHz).data[ii]/fmtotSI,+1,f0,sigma);
235  }
236 
237  return XLAL_SUCCESS;
238 }
239 
240 /** @} */
241 /** @} */
242 
const double b1
const double b2
REAL8 CalcRDFrequency(REAL8 MF, REAL8 chiF, REAL8 Mtot)
Returns ringdown frequency in units of the total mass using fits from gr-qc/0512160/.
REAL8 TanhWindow(const REAL8 f, const int sign, const REAL8 f0, const REAL8 sigma)
Tanh window function w^{+/-}_{f0,sigma}(f) = 0.5 * (1 +/- tanh(4*(f-f0)/sigma)) Auxiliary function us...
static double sigma(const double a, const double b, const sysq *system)
Internal function that computes the spin-spin couplings.
double e
Definition: bh_ringdown.c:117
const double Q
const double a2
#define LAL_C_SI
#define LAL_MSUN_SI
#define LAL_PI
#define LAL_G_SI
uint64_t UINT8
double REAL8
REAL8 XLALBHNS_spin_aligned(const REAL8 m1, const REAL8 m2, const REAL8 chi1, const REAL8 lam)
Compute final black hole spin for aligned black hole spin.
REAL8 XLALBHNS_mass_aligned(const REAL8 m1, const REAL8 m2, const REAL8 chi1, const REAL8 lam)
Compute final black hole mass for aligned black hole spin.
int XLALSEOBNRv4ROMNSBHAmplitudeCorrectionFrequencySeries(const REAL8Sequence *amp_tidal, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 lambda2)
Compute amplitude correction to SEOBNRv4_ROM_NRTidalv2 in LAL format at specified frequencies for the...
double XLALSimNSBH_compactness_from_lambda(const REAL8 Lambda)
Compactness as a function of tidal deformability.
double XLALSimNSBH_torus_mass_fit(const REAL8 q, const REAL8 a, const REAL8 C)
Baryonic mass of the torus remnant of a BH-NS merger.
double XLALSimNSBH_fGWinKerr(const REAL8 r, const REAL8 M, const REAL8 a)
GW frequency for a particle on Kerr.
double XLALSimNSBH_xi_tide(const REAL8 q, const REAL8 a, const REAL8 mu)
Relativistic correction to orbital radius at mass-shedding.
XLAL_SUCCESS
list x