LALSimulation  5.4.0.1-89842e6
LALSimIMRPhenomNSBH.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Jonathan Thompson, Edward Fauchon-Jones, Sebastian Khan
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 #include "LALSimIMRPhenomNSBH.h"
21 
22 /* This is ugly, but allows us to reuse internal IMRPhenomC and IMRPhenomD functions without making those functions XLAL */
25 
26 #include <gsl/gsl_errno.h>
27 #include <gsl/gsl_spline.h>
28 #include <gsl/gsl_poly.h>
29 
30 #ifndef _OPENMP
31 #define omp ignore
32 #endif
33 
34 
36  COMPLEX16FrequencySeries **htilde, /**< Output: Frequency-domain waveform h+ */
37  REAL8 phiRef, /**< Phase at reference time */
38  REAL8 fRef, /**< Reference frequency (Hz); 0 defaults to fLow */
39  REAL8 distance, /**< Distance of source (m) */
40  REAL8 mBH_SI, /**< Mass of BH (kg) */
41  REAL8 mNS_SI, /**< Mass of neutron star 2 (kg) */
42  REAL8 chi_BH, /**< Dimensionless aligned component spin of Black Hole */
43  REAL8 chi_NS, /**< Dimensionless aligned component spin of NS */
44  LALDict *extraParams, /**< extra params */
45  const REAL8Sequence *freqs_in, /**< Frequency points at which to evaluate the waveform (Hz) */
46  REAL8 deltaF) /**< Sampling frequency (Hz) */
47 {
48 
49  XLAL_CHECK(mBH_SI >= mNS_SI, XLAL_EDOM, "BH mass must be larger or equal to NS mass\n");
50  XLAL_CHECK(mBH_SI <= 100.0*mNS_SI, XLAL_EDOM, "Mass ratio must be less than or equal to 100");
51  if (chi_NS != 0.0)
52  XLALPrintWarning("IMRPhenomNSBH is not calibrated for a non-zero NS spin\n");
53 
54  /*sanity checks*/
55  /* Check output arrays */
56  if (!htilde)
57  XLAL_ERROR(XLAL_EFAULT, "htilde must not be a NULL pointer\n");
58  if (*htilde)
59  {
60  XLALPrintError("(*htilde) is supposed to be NULL, but got %p", (*htilde));
62  }
63 
64  /* Find frequency bounds */
65  if (!freqs_in)
66  XLAL_ERROR(XLAL_EFAULT, "freqs_in must not be a NULL pointer\n");
67  double f_min = freqs_in->data[0];
68  double f_max = freqs_in->data[freqs_in->length - 1];
69  XLAL_CHECK(f_min > 0, XLAL_EDOM, "Minimum frequency must be positive.\n");
70  XLAL_CHECK(f_max >= 0, XLAL_EDOM, "Maximum frequency must be non-negative.\n");
71  if (f_max > 0)
72  XLAL_CHECK(f_max >= f_min, XLAL_EDOM, "Maximum frequency must not be less than minimum frequency.\n");
73  if (fRef == 0.0)
74  fRef = f_min;
75 
76  IMRPhenomDPhaseCoefficients *pPhi = NULL;
77  PNPhasingSeries *pn = NULL;
78  REAL8Sequence *freqs = NULL;
79  LALDict *extraParams_in = extraParams;
80 
81  int retcode = XLALSimInspiralSetQuadMonParamsFromLambdas(extraParams);
82  XLAL_CHECK(retcode == XLAL_SUCCESS, XLAL_EFUNC, "Failed to set quadparams from Universal relation.\n");
84  XLAL_CHECK(lambda_NS <= 5000, XLAL_EDOM, "lambda2 must be less than or equal to 5000");
85 
86  /* External units: SI; internal units: solar masses */
87  const REAL8 mBH = mBH_SI / LAL_MSUN_SI;
88  const REAL8 mNS = mNS_SI / LAL_MSUN_SI;
89  const REAL8 M = mBH + mNS;
90  const REAL8 M_sec = M * LAL_MTSUN_SI; /* Total mass in seconds */
91  REAL8 eta = mBH * mNS / (M * M); /* Symmetric mass-ratio */
92  if (eta > 0.25)
93  PhenomInternal_nudge(&eta, 0.25, 1e-6);
94  if (eta > 0.25 || eta < 0.0)
95  XLAL_ERROR(XLAL_EDOM, "Unphysical eta. Must be between 0. and 0.25\n");
96  XLAL_CHECK(mNS <= 3.0, XLAL_EDOM, "NS mass must be less than or equal to 3 solar masses");
97  if(mNS < 1)
98  XLALPrintWarning("IMRPhenomNSBH is not calibrated for a NS mass less than 1\n");
99 
100  const REAL8 chi_eff = XLALSimIMRPhenomBComputeChi(mBH, mNS, chi_BH, chi_NS);
101  LIGOTimeGPS ligotimegps_zero = LIGOTIMEGPSZERO; // = {0, 0}
102 
103  UINT4 offset;
104  size_t n_full;
105 
106  // compute phenomC attributes
107  BBHPhenomCParams *params = ComputeIMRPhenomCParams(mBH, mNS, chi_eff, extraParams);
108  if (!params)
109  XLAL_ERROR(XLAL_EFAULT, "PhenomC properties was returned as a NULL pointer");
110  if (params->g1 < 0.0) {
111  XLALPrintWarning("IMRPhenomNSBH phenomenological coefficient gamma_1 = %f. gamma_1 has been increased to 0.0 to remove unphysical zeros in the amplitude\n", params->g1);
112  params->g1 = 0.0;
113  }
114  if (params->del1 < 0.0) {
115  XLALPrintWarning("IMRPhenomNSBH phenomenological coefficient delta_1 = %f. delta_1 has been increased to 0.0 to remove unphysical zeros in the amplitude\n", params->del1);
116  params->del1 = 0.0;
117  }
118  if (params->del2 < 1.0E-4) {
119  XLALPrintWarning("IMRPhenomNSBH phenomenological coefficient delta_2 = %f. delta_2 has been increased to 1e-4 to remove unphysical zeros in the amplitude\n", params->del2);
120  params->del2 = 1.0E-4;
121  }
122 
123  // compute phenomNSBH terms; this only takes the BH spin, not chi_eff
124  BBHPhenomNSBHParams *NSBH_params = ComputeIMRPhenomNSBHParams(mBH, mNS, chi_BH, lambda_NS, params);
125  if (!NSBH_params)
126  XLAL_ERROR(XLAL_EFAULT, "PhenomNSBH properties was returned as a NULL pointer");
127 
128  // Prepare frequeny series
129  if (f_max == 0) {
130  f_max = 0.2 / M_sec;
131  }
132 
133  if (deltaF > 0){ // freqs contains uniform frequency grid with spacing deltaF; we start at frequency 0
134 
135  n_full = PhenomInternal_NextPow2(f_max / deltaF) + 1;
136 
137  XLAL_CHECK(XLALGPSAdd(&ligotimegps_zero, -1.0 / deltaF), XLAL_EFUNC, "Failed to shift coalescence time to t=0, tried to apply shift of -1.0/deltaF with deltaF=%g.", deltaF);
138  *htilde = XLALCreateCOMPLEX16FrequencySeries("htilde: FD waveform", &ligotimegps_zero, 0.0, deltaF, &lalStrainUnit, n_full);
139  XLAL_CHECK(*htilde, XLAL_ENOMEM, "Failed to allocate waveform COMPLEX16FrequencySeries of length %zu for f_max=%f, deltaF=%g.", n_full, f_max, deltaF);
140 
141  // Recreate freqs using only the lower and upper bounds
142  UINT4 iStart = (UINT4)(f_min / deltaF);
143  UINT4 iStop = (UINT4)(f_max / deltaF);
144  freqs = XLALCreateREAL8Sequence(iStop - iStart);
145  if (!freqs)
146  XLAL_ERROR(XLAL_EFUNC, "Frequency array allocation failed.");
147  for (UINT4 i = iStart; i < iStop; i++)
148  freqs->data[i - iStart] = i * deltaF;
149 
150  offset = iStart;
151 
152  } else { // freqs contains frequencies with non-uniform spacing; we start at lowest given frequency
153  n_full = freqs_in->length;
154 
155  *htilde = XLALCreateCOMPLEX16FrequencySeries("htilde: FD waveform", &ligotimegps_zero, f_min, deltaF, &lalStrainUnit, n_full);
156  XLAL_CHECK(*htilde, XLAL_ENOMEM, "Failed to allocated waveform COMPLEX16FrequencySeries of length %zu from sequence.", n_full);
157 
158  freqs = XLALCreateREAL8Sequence(freqs_in->length);
159  if (!freqs)
160  XLAL_ERROR(XLAL_EFUNC, "Frequency array allocation failed.");
161  for (UINT4 i = 0; i < n_full; i++)
162  freqs->data[i] = freqs_in->data[i]; // just copy input
163  offset = 0;
164  }
165 
166  //n_full is now the length for the FrequencySeries
167  memset((*htilde)->data->data, 0, n_full * sizeof(COMPLEX16));
168  XLALUnitMultiply(&((*htilde)->sampleUnits), &((*htilde)->sampleUnits), &lalSecondUnit);
169 
170  // compute phenomD phase
171  int errcode = init_useful_powers(&powers_of_pi, LAL_PI);
172  XLAL_CHECK(XLAL_SUCCESS == errcode, errcode, "init_useful_powers() failed.");
173 
174  // IMRPhenomD assumes that m1 >= m2.
175  pPhi = XLALMalloc(sizeof(IMRPhenomDPhaseCoefficients));
176 
177  // final spin
178  REAL8 finspin = NSBH_params->chif;
179 
180  ComputeIMRPhenomDPhaseCoefficients(pPhi, eta, chi_BH, chi_NS, finspin, extraParams);
181  if (extraParams == NULL)
182  {
183  extraParams = XLALCreateDict();
184  }
186  XLALSimInspiralTaylorF2AlignedPhasing(&pn, mBH, mNS, chi_BH, chi_NS, extraParams);
187 
188  // Subtract 3PN spin-spin term below as this is in LAL's TaylorF2 implementation
189  // (LALSimInspiralPNCoefficients.c -> XLALSimInspiralPNPhasing_F2), but
190  // was not available when PhenomD was tuned.
191  pn->v[6] -= (Subtract3PNSS(mBH, mNS, M, eta, chi_BH, chi_NS) * pn->v[0]);
192 
193  PhiInsPrefactors phi_prefactors;
194  errcode = init_phi_ins_prefactors(&phi_prefactors, pPhi, pn);
195  XLAL_CHECK(XLAL_SUCCESS == errcode, errcode, "init_phi_ins_prefactors failed");
196 
197  ComputeIMRPhenDPhaseConnectionCoefficients(pPhi, pn, &phi_prefactors, 1.0, 1.0);
198 
199  // incorporating fRef
200  const REAL8 MfRef = M_sec * fRef;
201  UsefulPowers powers_of_fRef;
202  int status = init_useful_powers(&powers_of_fRef, MfRef);
203  XLAL_CHECK(XLAL_SUCCESS == status, status, "init_useful_powers failed for MfRef");
204  const REAL8 phi0 = IMRPhenDPhase(MfRef, pPhi, pn, &powers_of_fRef, &phi_prefactors, 1.0, 1.0);
205 
206  // factor of 2 b/c phi0 is orbital phase
207  const REAL8 phi_precalc = 2. * phiRef + phi0;
208 
209  // use fmax frequency to compute t0
210  REAL8 t0 = DPhiMRD(f_max * M_sec, pPhi, 1.0, 1.0);
211 
212  // get tidal phase
213  REAL8Sequence *phi_tidal = XLALCreateREAL8Sequence(n_full);
214  // amp_tidal and planck_taper are not used but this function calculates it anyway.
215  REAL8Sequence *amp_tidal = XLALCreateREAL8Sequence(n_full);
216  REAL8Sequence *planck_taper = XLALCreateREAL8Sequence(n_full);
218  phi_tidal, amp_tidal, planck_taper, freqs,
219  mBH_SI, mNS_SI, 0.0, lambda_NS, NRTidalv2_V);
220  XLAL_CHECK(XLAL_SUCCESS == status, status, "XLALSimNRTunedTidesFDTidalPhaseFrequencySeries Failed.");
221 
222  const REAL8 amp0 = XLALSimPhenomUtilsFDamp0(M, distance);
223  const REAL8 ylm_fac = 2. * sqrt(5. / (64. * LAL_PI));
224  // loop over frequencies
225  int status_in_for = XLAL_SUCCESS;
226  for (UINT4 i = 0; i < freqs->length; i++)
227  { // loop over frequency points in sequence
228  double fHz = freqs->data[i];
229  double Mf = M_sec * fHz;
230  int j = i + offset; // shift index for frequency series if needed
231 
232  UsefulPowers powers_of_f;
233  status_in_for = init_useful_powers(&powers_of_f, Mf);
234  if (XLAL_SUCCESS != status_in_for)
235  {
236  XLALPrintError("init_useful_powers failed for Mf, status_in_for=%d", status_in_for);
237  status = status_in_for;
238  }
239  else{
240 
241  REAL8 amp = PhenomNSBHAmplitudeOneFrequency(fHz, params, NSBH_params);
242 
243  REAL8 phi = IMRPhenDPhase(Mf, pPhi, pn, &powers_of_f, &phi_prefactors, 1.0, 1.0);
244  phi += phi_tidal->data[i] - t0 * (Mf - MfRef) - phi_precalc;
245  ((*htilde)->data->data)[j] = amp0 * amp * cexp(-I * phi) * ylm_fac;
246  }
247  }
248 
249  // clean up and return
250 
251  /* If extraParams was allocated in this function and not passed in
252  * we need to free it to prevent a leak */
253  if (extraParams && !extraParams_in)
254  {
255  XLALDestroyDict(extraParams);
256  }
257  else
258  {
260  }
261 
262  if (params)
263  XLALFree(params);
264  if (NSBH_params)
265  XLALFree(NSBH_params);
266  if (pPhi)
267  XLALFree(pPhi);
268  if (pn)
269  XLALFree(pn);
270 
271  if (freqs)
273 
274  if (phi_tidal)
275  XLALDestroyREAL8Sequence(phi_tidal);
276  if (amp_tidal)
277  XLALDestroyREAL8Sequence(amp_tidal);
278  if (planck_taper)
279  XLALDestroyREAL8Sequence(planck_taper);
280 
281  return XLAL_SUCCESS;
282 }
283 
284 
285 /**
286  * Computes PhenomNSBH Amplitude at a single frequency
287  */
289  const REAL8 f, /**< frequency Hz */
290  const BBHPhenomCParams *params, /**< pointer to Object storing coefficients and constants: PhenomC */
291  const BBHPhenomNSBHParams *params_NSBH /**< pointer to Object storing coefficients and constants: PhenomC_NSBH */
292 )
293 {
294 
295  REAL8 v = cbrt(params->piM * f);
296  REAL8 Mf = params->m_sec * f;
297 
298  REAL8 v2 = v * v;
299  REAL8 v3 = v * v2;
300  REAL8 v4 = v2 * v2;
301  REAL8 v5 = v3 * v2;
302  REAL8 v6 = v3 * v3;
303  REAL8 v7 = v4 * v3;
304  REAL8 v10 = v5 * v5;
305 
306  /* Get the amplitude */
307  REAL8 xdot = 1. + params->xdota2 * v2 + params->xdota3 * v3 + params->xdota4 * v4 +
308  params->xdota5 * v5 + (params->xdota6 + params->xdota6log * log(v2)) * v6 +
309  params->xdota7 * v7;
310  xdot *= (params->xdotaN * v10);
311 
312  if (xdot < 0.0 && f < params->f1)
313  {
314  XLALPrintError("omegaDot < 0, while frequency is below SPA-PM matching freq.");
316  }
317 
318  REAL8 aPN = 0.0;
319  REAL8 aPM = 0.0;
320 
321  /* Following Emma's code, take only the absolute value of omegaDot, when
322  * computing the amplitude */
323  REAL8 omgdot = 1.5 * v * xdot;
324  REAL8 ampfac = sqrt(fabs(LAL_PI / omgdot));
325 
326  /* Get the real and imaginary part of the PM amplitude */
327  REAL8 AmpPNre = ampfac * params->AN * v2 * (1. + params->A2 * v2 + params->A3 * v3 + params->A4 * v4 + params->A5 * v5 + (params->A6 + params->A6log * log(v2)) * v6);
328  REAL8 AmpPNim = ampfac * params->AN * v2 * (params->A5imag * v5 + params->A6imag * v6);
329 
330  /* Following Emma's code, we take the absolute part of the complex SPA
331  * amplitude, and keep that as the amplitude */
332  aPN = sqrt(AmpPNre * AmpPNre + AmpPNim * AmpPNim);
333 
334  aPM = (params_NSBH->gamma_correction * params->g1 * pow(Mf, (5. / 6.))); //gamma_correction is 1 in BBH case
335 
336  /* The Ring-down aamplitude */
337  REAL8 Mfrd = 0.0;
338  REAL8 sig2 = 0.0;
339 
340  Mfrd = params_NSBH->f_RD;
341  sig2 = params_NSBH->sigma * params_NSBH->sigma;
342 
343  REAL8 L = sig2 / ((Mf - Mfrd) * (Mf - Mfrd) + sig2 / 4.);
344 
345  REAL8 aRD = params_NSBH->epsilon_tide * params->del1 * L * pow(Mf, (-7. / 6.)); //epsilon_tide is 1 in BBH case
346 
347  /* final amplitude contributions */
348  REAL8 wMinusf0_PN = 0.0;
349  REAL8 wMinusf0_PM = 0.0;
350  REAL8 wPlusf0 = 0.0;
351 
352  wMinusf0_PN = wMinus(f, params_NSBH->epsilon_ins * params_NSBH->f0_tilde_PN, params->d0 + params_NSBH->sigma_tide, params);
353  wMinusf0_PM = wMinus(f, params_NSBH->f0_tilde_PM, params->d0 + params_NSBH->sigma_tide, params);
354  wPlusf0 = wPlus(f, params_NSBH->f0_tilde_RD, params->d0 + params_NSBH->sigma_tide, params);
355 
356  REAL8 amp = -(aPN * wMinusf0_PN + aPM * wMinusf0_PM + aRD * wPlusf0);
357 
358  return amp;
359 }
360 
361 /**
362  * PhenomC parameters for NSBH amplitude model
363  */
365  const REAL8 m1, /**< Mass of companion 1 (solar masses) */
366  const REAL8 m2, /**< Mass of companion 2 (solar masses) */
367  const REAL8 chi, /**< Dimensionless spin of black hole */
368  const REAL8 lambda, /**< Dimensionless tidal deformability of NS */
369  const BBHPhenomCParams *params /**< pointer to Object storing coefficients and constants: PhenomC */
370 )
371 {
372 
374  if (!p)
376  memset(p, 0, sizeof(BBHPhenomNSBHParams));
377 
378  /**
379  * Compute NSBH parameters
380  */
381 
382  /**
383  * mixed_merger
384  */
385 
386  const REAL8 q = m1 / m2;
387  const REAL8 MBH = m1;
388  const REAL8 MNS = m2;
389  p->m_sec = (MBH+MNS) * LAL_MTSUN_SI;
390  p->lambda = lambda;
391 
392  // Get NS compactness and baryonic mass
394 
395  // Get Torus mass/NS baryonic mass
396  p->Mtorus = XLALSimNSBH_torus_mass_fit(q, chi, p->C);
397 
398  // Get remnant spin for assumed aligned spin system
399  p->chif = XLALBHNS_spin_aligned(MBH, MNS, chi, lambda);
400 
401  // Get remnant mass scaled to a total (initial) mass of 1
402  const REAL8 Mtot = MBH + MNS;
403  p->final_mass = XLALBHNS_mass_aligned(MBH, MNS, chi, lambda) / Mtot;
404 
405  const COMPLEX16 omega_tilde = XLALSimIMRPhenomNSBH_omega_tilde(p->chif);
406 
407  // Prepare remnant dependant quantities
408  p->f_RD = creal(omega_tilde)/2.0/LAL_PI/p->final_mass;
409  const REAL8 mu = q * p->C;
410  const REAL8 xi = XLALSimNSBH_xi_tide(q, chi, mu);
411 
412  // In MBH units, 1-2C follows arXiv:1207.6304v1 on the torus mass
413  const REAL8 rtide = xi * (1.0 - 2.0 * p->C) / mu;
414 
415  p->q_factor = creal(omega_tilde)/cimag(omega_tilde)/2.0;
416  p->f_tide = fabs( XLALSimNSBH_fGWinKerr(rtide, 1.0, chi) * (1.0 + 1.0 / q) );
417 
418  /**
419  * amp
420  */
421 
422  const REAL8 f_RD_tilde = 0.99 * 0.98 * p->f_RD;
423 
424  // NSBH systems seem to require a correction to gamma fitted to BBH cases
425  const REAL8 lambda2 = lambda*lambda;
426  if (lambda > 1.0)
427  p->gamma_correction = 1.25;
428  else
429  p->gamma_correction = 1.0 + 0.5*lambda - 0.25*lambda2;
430 
431  // Ringdown damping w/ fudge factor
432  if (lambda > 1.0) {
433  p->delta_2_prime = XLALSimIMRPhenomNSBH_delta2_prime(p->f_tide, f_RD_tilde);
434  } else {
435  const REAL8 c_2 = params->del2 - 0.81248;
436  p->delta_2_prime = params->del2 - 2*c_2*lambda + c_2*lambda2;
437  }
438  p->sigma = p->delta_2_prime * p->f_RD / p->q_factor;
439 
440  // Determine the type of merger we see
441  if (p->f_tide < p->f_RD)
442  {
443  // mildly disruptive or totally disruptive, f_tide < f_RD
444  p->epsilon_tide = 0.0;
445 
446  p->epsilon_ins = XLALSimIMRPhenomNSBH_epsilon_ins_with_torus_mass(p->Mtorus, p->C, q, chi);
447  if (p->epsilon_ins > 1.)
448  p->epsilon_ins = 1.;
449 
450  p->sigma_tide = XLALSimIMRPhenomNSBH_sigma_tide_with_torus_mass(p->Mtorus, p->C, q, chi);
451  if (p->Mtorus > 0.0)
452  {
453  // totally disruptive merger, Mtorus > 0
454  p->merger_type = DISRUPTIVE;
455  p->f0_tilde_PN = p->f_tide / p->m_sec;
456  p->f0_tilde_PM = p->f_tide / p->m_sec;
457  p->f0_tilde_RD = 0.0;
458  }
459  else
460  {
461  // mildly disruptive with no remnant, Mtorus == 0
462  p->merger_type = MILDLY_DISRUPTIVE_NO_TORUS_REMNANT;
463 
464  const REAL8 f1 = (1.0 - 1.0 / q) * f_RD_tilde + p->epsilon_ins * p->f_tide / q;
465  const REAL8 f2 = (1.0 - 1.0 / q) * f_RD_tilde + p->f_tide / q;
466 
467  p->f0_tilde_PN = f1 / p->m_sec;
468  p->f0_tilde_PM = f2 / p->m_sec;
469  p->f0_tilde_RD = 0.0;
470 
471  // for this case, sigma_tide is computed by averaging the
472  // disruptive and non-disruptive values
473  const REAL8 sigma_tide_ND = XLALSimIMRPhenomNSBH_sigma_tide_ND(
474  XLALSimIMRPhenomNSBH_x_ND_prime(p->f_tide, f_RD_tilde, p->C, chi));
475  p->sigma_tide = (p->sigma_tide + sigma_tide_ND) / 2.0;
476  }
477  }
478  else
479  {
480  // mildly disruptive or non-disruptive, f_tide >= f_RD
481  if (lambda > 1.0) {
482  p->f0_tilde_PN = f_RD_tilde / p->m_sec;
483  p->f0_tilde_PM = f_RD_tilde / p->m_sec;
484  p->f0_tilde_RD = f_RD_tilde / p->m_sec;
485  } else {
486  const REAL8 f0 = (1.0 - 0.02*lambda + 0.01*lambda2)*0.98*p->f_RD;
487  p->f0_tilde_PN = f0 / p->m_sec;
488  p->f0_tilde_PM = f0 / p->m_sec;
489  p->f0_tilde_RD = f0 / p->m_sec;
490  }
491 
492  p->epsilon_tide = XLALSimIMRPhenomNSBH_epsilon_tide_ND(
493  XLALSimIMRPhenomNSBH_x_ND(p->f_tide, f_RD_tilde, p->C, chi));
495  XLALSimIMRPhenomNSBH_x_ND_prime(p->f_tide, f_RD_tilde, p->C, chi));
496 
497  if (p->Mtorus > 0.0)
498  {
499  // mildly disruptive with remnant mass, f_tide > f_RD AND Mtorus > 0
500  p->merger_type = MILDLY_DISRUPTIVE_TORUS_REMNANT;
501  p->epsilon_ins = XLALSimIMRPhenomNSBH_epsilon_ins_with_torus_mass(p->Mtorus, p->C, q, chi);
502  }
503  else
504  {
505  // non-disruptive, f_tide > f_RD AND Mtorus == 0
506  p->merger_type = NON_DISRUPTIVE;
507  p->epsilon_ins = 1.0;
508  }
509  }
510 
511  return p;
512 }
513 
514 /**
515  * @addtogroup LALSimIMRPhenom_c
516  *
517  * @{
518  *
519  * @name Routines for IMR Phenomenological Model "NSBH"
520  *
521  * @{
522  *
523  * @author Jonathan Thompson, Edward Fauchon-Jones, Sebastian Khan
524  *
525  * @brief C code for <code>IMRPhenomNSBH</code> phenomenological waveform model.
526  *
527  * This is a single-spin, non-precessing frequency domain model. This model is
528  * based on the amplitude model described by \cite Pannarale:2015jka and the
529  * <code>IMRPhenomD</code> based NRTidal phase model described by
530  * \cite Dietrich:2019kaq. Please see
531  * <a href="https://dcc.ligo.org/LIGO-T1900729">LIGO-T1900729</a> for a
532  * technical description of the implemented model.
533  *
534  * @note The model can be evaluated within the following parameter space
535  * boundary outside of which an <code>XLAL_EDOM</code> error will be thrown
536  * * \f$ m_{\mathrm{NS}} \leq 3 M_{\odot} \f$
537  * * \f$ 1 \leq q \leq 100 \f$
538  * * \f$ 0 \leq \Lambda_2 \leq 5000 \f$
539  *
540  * @note The model will throw a warning if it is evaluated inside the above
541  * parameter space boundary but violates any of the following conditions
542  * * \f$ \chi_{\mathrm{NS}} = 0 \f$
543  * * \f$ m_{\mathrm{NS}} \geq 1 M_{\odot} \f$
544  * * \f$ \delta_1 \geq 0 \f$
545  * * \f$ \delta_2 \geq 10^{-4} \f$
546  * * \f$ \gamma_1 \geq 0 \f$
547  *
548  * @note If any of the conditions on the phenomenological coefficient \f$
549  * \delta_1, \delta_2, \gamma_1 \f$ are violated then they are increased to the
550  * values \f$ 0, 10^{-4}, 0 \f$ respectively to remove unphysical zeros in the
551  * amplitude.
552  *
553  * @note The models amplitude was calibrated to mass-ratios [1:2,1:3,1:4,1:5].
554  * * Along the mass-ratio 1:2 line it was calibrated to BH spins [-0.5, 0.75].
555  * * Along the mass-ratio 1:3 line it was calibrated to BH spins [-0.5, 0.75].
556  * * Along the mass-ratio 1:4 line it was calibrated to BH spins [0, 0.75].
557  * * Along the mass-ratio 1:5 line it was calibrated to BH spins [0, 0.75].
558  *
559  * @note Please see \cite Yamamoto:2008js, \cite Lackey:2013axa and
560  * \cite Pannarale:2015jka for full details of the NR data used to calibrate
561  * the amplitude for this model.
562  *
563  * @note The models phase uses the phase of <code>IMRPhenomD_NRTidalv2</code>. For
564  * full details of the NR data used to calibrate the phase for this model please
565  * see \cite Husa:2015iqa, \cite Khan:2015jqa and \cite Dietrich:2019kaq
566  *
567  * @attention The model is usable outside this parameter range,
568  * and tests have shown that the model produces sensible results. However the
569  * current set of numerical relativity simulations for NSBH systems is limited.
570  * In particular they do not cover the mass ratio ranges and spin ranges of
571  * numerical relativity simulations that are available for BBH systems. As such
572  * you should carefully consider applications of this model for use case when
573  * evaluated outside the suggested parameter space. For more information please
574  * see the review wiki which can be found at
575  * https://git.ligo.org/waveforms/reviews/nsbh-models/wikis/home.
576  *
577  */
578 
579 /**
580  * Compute waveform in LAL format at specified frequencies for the IMRPhenomNSBH model.
581  *
582  * XLALSimIMRPhenomNSBH() returns the plus and cross polarizations as a complex
583  * frequency series with equal spacing deltaF and contains zeros from zero frequency
584  * to the starting frequency and zeros beyond the cutoff frequency in the ringdown.
585  *
586  * In contrast, XLALSimIMRPhenomNSBHFrequencySequence() returns a
587  * complex frequency series with entries exactly at the frequencies specified in
588  * the sequence freqs (which can be unequally spaced). No zeros are added.
589  *
590  * This function is designed as an entry point for reduced order quadratures.
591  */
593  COMPLEX16FrequencySeries **htilde, /**< Output: Frequency-domain waveform h+ */
594  const REAL8Sequence *freqs, /**< Frequency points at which to evaluate the waveform (Hz) */
595  REAL8 phiRef, /**< Phase at reference time */
596  REAL8 fRef, /**< Reference frequency (Hz); 0 defaults to fLow */
597  REAL8 distance, /**< Distance of source (m) */
598  REAL8 mBH_SI, /**< Mass of BH (kg) */
599  REAL8 mNS_SI, /**< Mass of neutron star 2 (kg) */
600  REAL8 chi_BH, /**< Dimensionless aligned component spin of Black Hole */
601  REAL8 chi_NS, /**< Dimensionless aligned component spin of NS */
602  LALDict *extraParams /**< linked list containing the extra testing GR parameters and tidal parameters */
603 )
604 {
605  if (!freqs)
606  XLAL_ERROR(XLAL_EFAULT, "freqs must not be a NULL pointer\n");
607 
608  // Call the internal core function with deltaF = 0 to indicate that freqs is non-uniformly
609  // spaced and we want the strain only at these frequencies
610  int retcode = IMRPhenomNSBH_Core(htilde,
611  phiRef, fRef, distance, mBH_SI, mNS_SI, chi_BH, chi_NS, extraParams, freqs, 0);
612 
613  return (retcode);
614 }
615 
616 /**
617  * Driver routine to compute the single-spin, non-precessing,
618  * neutron-star-black-hole, inspiral-merger-ringdown phenomenological waveform
619  * IMRPhenomNSBH in the frequency domain in LAL format.
620  *
621  * All input parameters should be in SI units. Angles should be in radians.
622  *
623  * Returns the plus and cross polarizations as a complex frequency series with
624  * equal spacing deltaF and contains zeros from zero frequency to the starting
625  * frequency fLow and zeros beyond the cutoff frequency in the ringdown.
626  */
628  COMPLEX16FrequencySeries **htilde, /**< Output: Frequency-domain waveform h+ */
629  REAL8 phiRef, /**< Phase at reference time */
630  REAL8 deltaF, /**< Sampling frequency (Hz) */
631  REAL8 fLow, /**< Starting GW frequency (Hz) */
632  REAL8 fHigh, /**< End frequency; 0 defaults to Mf=0.2 */
633  REAL8 fRef, /**< Reference frequency (Hz); 0 defaults to fLow */
634  REAL8 distance, /**< Distance of source (m) */
635  REAL8 mBH_SI, /**< Mass of BH (kg) */
636  REAL8 mNS_SI, /**< Mass of neutron star 2 (kg) */
637  REAL8 chi_BH, /**< Dimensionless aligned component spin of Black Hole */
638  REAL8 chi_NS, /**< Dimensionless aligned component spin of NS */
639  LALDict *extraParams /**< linked list containing the extra testing GR parameters and tidal parameters */
640 )
641 {
642  // Use fLow, fHigh, deltaF to compute freqs sequence
643  // Instead of building a full sequence we only transfer the boundaries and let
644  // the internal core function do the rest (and properly take care of corner cases).
646  freqs->data[0] = fLow;
647  freqs->data[1] = fHigh;
648 
649  int retcode = IMRPhenomNSBH_Core(htilde,
650  phiRef, fRef, distance, mBH_SI, mNS_SI, chi_BH, chi_NS, extraParams, freqs, deltaF);
651 
653 
654  return (retcode);
655 }
656 
657 
658 /***********************************************/
659 /* Utility functions for PhenomNSBH parameters */
660 /***********************************************/
661 
662 /**
663  * @addtogroup LALSimIMRPhenomNSBHUtility XLALSimIMRPhenomNSBHUtility
664  * @brief C code for utility routines for <code>IMRPhenomNSBH</code>
665  * phenomenological waveform model.
666  *
667  * @{
668  *
669  * @name Utility routines for IMR Phenomenological Model "NSBH"
670  *
671  * @{
672  *
673  * @author Jonathan Thompson, Edward Fauchon-Jones, Sebastian Khan
674  */
675 
676 /**
677  * Convenience function for expression appearing in disruptive merger
678  *
679  * Combination of parameters that helps understand and handle disruptive cases
680  * which produce tori. This is Eq. (23) in arXiv:1509.00512 on pg. (7).
681  */
683  const REAL8 Mtorus, /**< Baryonic mass of the torus remnant of a BH-NS merger in units of the NS baryonic mass. */
684  const REAL8 C, /**< Neutron star compactness */
685  const REAL8 q, /**< Mass ratio of the NSBH system M_BH/M_NS > 1 */
686  const REAL8 chi /**< Dimensionless spin parameter -1 <= chi <= 1 */
687 ) {
689  return Mtorus + 0.424912*C + 0.363604*sqrt(nu) - 0.0605591*chi;
690 }
691 
692 /**
693  * Correction to the inspiral transition frequency with spin contributions
694  *
695  * Correction factor that multiplies the inspiral transition frequency when
696  * the mixed phenom GW is generated. See https://arxiv.org/abs/1509.00512 Eq.
697  * (23) (p7) for it's definition.
698  */
700  const REAL8 Mtorus, /**< Baryonic mass of the torus remnant of a BH-NS merger in units of the NS baryonic mass. */
701  const REAL8 C, /**< Neutron star compactness */
702  const REAL8 q, /**< Mass ratio of the NSBH system M_BH/M_NS > 1 */
703  const REAL8 chi /**< Dimensionless spin parameter -1 <= chi <= 1 */
704 ) {
705  return 1.29971 - 1.61724 * XLALSimIMRPhenomNSBH_x_D(Mtorus, C, q, chi);
706 }
707 
708 /**
709  * Convinience function for expression appearing in disruptive merger
710  *
711  * Combination of parameters that helps understand and handle disruptive cases
712  * which produce tori.
713  *
714  * See Eq. (25) of arXiv:1509:00512
715  */
717  const REAL8 Mtorus, /**< Baryonic mass of the torus remnant of a BH-NS merger in units of the NS baryonic mass. */
718  const REAL8 C, /**< Neutron star compactness */
719  const REAL8 q, /**< Mass ratio of the NSBH system M_BH/M_NS > 1 */
720  const REAL8 chi /**< Dimensionless spin parameter -1 <= chi <= 1 */
721 ) {
723  return Mtorus - 0.132754*C + 0.576669*sqrt(nu) - 0.0603749*chi - 0.0601185*pow(chi, 2.0) - 0.0729134*pow(chi, 3.0);
724 }
725 
726 /**
727  * Correction to ringdown Lorentzian width for disruptive mergers
728  *
729  * Correction to the Lorentzian width parameter in the ringdown ansatz used when
730  * the mixed phenom GW is generated for disruptive mergers that do produce tori.
731  * See https://arxiv.org/abs/1509.00512 Eq. (24) (p7) for it's definition.
732  */
734  const REAL8 Mtorus, /**< Baryonic mass of the torus remnant of a BH-NS merger in units of the NS baryonic mass. */
735  const REAL8 C, /**< Neutron star compactness */
736  const REAL8 q, /**< Mass ratio of the NSBH system M_BH/M_NS > 1 */
737  const REAL8 chi /**< Dimensionless spin parameter -1 <= chi <= 1 */
738 ) {
739  return 0.137722 - 0.293237*XLALSimIMRPhenomNSBH_x_D_prime(Mtorus, C, q, chi);
740 }
741 
742 /**
743  * PhenomC parameter delta_1 NSBH correction factor
744  *
745  * Factor that mutltiplies the (PhenomC) parameter delta_1 when the mixed phenom
746  * GW is generated. See https://arxiv.org/abs/1509.00512 Eq. (16) (p5) for its
747  * definition.
748  */
750  const REAL8 x_ND /**< Dimensionless fit parameters x_ND. See https://arxiv.org/abs/1506.00512 Eq. (17) (p6) for it's original definition (x_ND). */
751 ) {
752  return 2.0*XLALSimIMRPhenomNSBH_window_plus(x_ND, -0.0796251, 0.0801192);
753 }
754 
755 /**
756  * Correction to ringdown Lorentzian width for nondisruptive mergers
757  *
758  * Correction to the Lorentzian width parameter in the ringdown ansatz used when
759  * the mixed phenom GW is generated for nondisruptive mergers that do not
760  * produce tori. See https://arxiv.org/abs/1509.00512 Eq. (18) (p6) for its
761  * definition.
762  */
764  const REAL8 x_ND_prime /**< Dimensionless fit parameter. See https://arxiv.org/abs/1509.00512 Eq. (19) (p6) for it's original definition (x_ND'). */
765 ) {
766  return 2.0*XLALSimIMRPhenomNSBH_window_minus(x_ND_prime, -0.206465, 0.226844);
767 }
768 
769 /**
770  * Convinience function for expression appearing in disruptive merger
771  *
772  * Combination of parameters that helps understand and handle non-disruptive
773  * cases. See Eq. (17) of arXiv:1509:00512
774  */
776  const REAL8 f_tide, /**< Frequency at which the tidal interactions occur */
777  const REAL8 f_RD_tilde, /**< Scaled ringdown frequency */
778  const REAL8 C, /**< Neutron star compactness */
779  const REAL8 chi /**< Dimensionless spin parameter -1 <= chi <= 1 */
780 ) {
781  return pow((f_tide - f_RD_tilde)/f_RD_tilde, 2.0) - 0.571505*C - 0.00508451*chi;
782 }
783 
784 /**
785  * Convinience function for expression appearing in disruptive merger
786  *
787  * Combination of parameters that helps understand and handle non-disruptive
788  * cases. See Eq. (19) of arXiv:1509:00512
789  */
791  const REAL8 f_tide, /**< Frequency at which the tidal interactions occur */
792  const REAL8 f_RD_tilde, /**< Scaled ringdown frequency */
793  const REAL8 C, /**< Neutron star compactness */
794  const REAL8 chi /**< Dimensionless spin parameter -1 <= chi <= 1 */
795 ) {
796  return pow((f_tide - f_RD_tilde)/f_RD_tilde, 2.0) - 0.657424*C - 0.0259977*chi;
797 }
798 
799 /**
800  * Fitted coefficient for PhenomC Lorentzian
801  *
802  * See Eq. (20) of arXiv:1509:00512
803  */
805  const REAL8 f_tide, /**< Frequency at which the tidal interactions occur */
806  const REAL8 f_RD_tilde /**< Scaled ringdown frequency */
807 ) {
808  return 1.62496*XLALSimIMRPhenomNSBH_window_plus((f_tide - f_RD_tilde)/f_RD_tilde, 0.0188092, 0.338737);
809 }
810 
811 /**
812  * Hyperbolic tangent sigmoid function
813  *
814  * This function approaches 0.5 as f approaches infinity. It approaches 0 as
815  * f approaches -infinity. It's value will be 0.25 at f0. As d approaches 0
816  * it approaches a step function.
817  */
819  const REAL8 f, /**< Value at which to evaluate sigmoid function */
820  const REAL8 f0, /**< Center of sigmoid function */
821  const REAL8 d /**< Width of sigmoid function */
822 ) {
823  return 0.25*(1 + tanh(4.0*(f-f0)/d));
824 }
825 
826 /**
827  * Hyperbolic tangent sigmoid function
828  *
829  * This function approaches 0.5 as f approaches -infinity. It approaches 0 as
830  * f approaches infinity. It's value will be 0.25 at f0. As d approaches 0
831  * it approaches a step function.
832  */
834  const REAL8 f, /**< Value at which to evaluate sigmoid function */
835  const REAL8 f0, /**< Center of sigmoid function */
836  const REAL8 d /**< Width of sigmoid function */
837 ) {
838  return 0.25*(1 - tanh(4.0*(f-f0)/d));
839 }
840 
841 /**
842  * Convenience function to calculate symmetric mass ratio from q
843  */
845  const REAL8 q /**< Mass ratio */
846 ) {
847  return q/pow(1.0+q, 2.0);
848 }
849 
850 /**
851  * NS baryonic mass as a function of NS gravitational mass
852  *
853  * NS baryonic mass as a function of NS gravitational mass. Both are in solar
854  * mass units. See Eq. (22) in https://arxiv.org/abs/1601.06083 for the
855  * definition of this expression.
856  */
858  const REAL8 C, /**< Compactness of neutron star. */
859  const REAL8 Mg /**< Neutron star gravitational mass. */
860 ) {
861  REAL8 d1 = 6.19E-1;
862  REAL8 d2 = 1.359E-1;
863  return Mg + Mg*(d1*C + d2*pow(C,2.0));
864 }
865 
866 /**
867  * 220 quasi-normal mode dimensionless frequency
868  *
869  * See Eq. (22) (p8) in https://arxiv.org/abs/1810.03550 for the definition of
870  * this quantity.
871  */
873  const REAL8 a /**< Dimensionless final spin parameter of the BH remnant */
874 ) {
875  REAL8 kappa = pow(log(2-a)/log(3), 0.5);
876  COMPLEX16 omega_tilde = (1.0 + kappa*(
877  1.5578*cexp(I*2.9031)
878  + 1.9510*cexp(I*5.9210)*kappa
879  + 2.0997*cexp(I*2.7606)*pow(kappa,2)
880  + 1.4109*cexp(I*5.9143)*pow(kappa,3)
881  + 0.4106*cexp(I*2.7952)*pow(kappa,4)));
882  return omega_tilde;
883 }
884 
885 /* Write a wrapper function to return the NSBH parameters */
887  REAL8 *f_RD, /**< Output: NSBH ringdown frequency [Hz] */
888  REAL8 *f_tide, /**< Output: NSBH tidal disruption frequency [Hz] */
889  REAL8 *torus_mass, /**< Output: Torus remnant mass (kg) */
890  REAL8 *compactness, /**< Output: Compactness of neutron star */
891  REAL8 *final_mass, /**< Output: final mass after merger (kg) */
892  REAL8 *chif, /**< Output: final dimensionless spin */
893  REAL8 mBH_SI, /**< Mass of BH (kg) */
894  REAL8 mNS_SI, /**< Mass of neutron star 2 (kg) */
895  REAL8 chi_BH, /**< Dimensionless aligned component spin of Black Hole */
896  REAL8 lambda_NS /**< Dimensionless tidal deformability of NS */
897 )
898 {
899 
900  const double mBH = mBH_SI / LAL_MSUN_SI;
901  const double mNS = mNS_SI / LAL_MSUN_SI;
902  const double M_sec = (mBH + mNS) * LAL_MTSUN_SI;
903 
904  const REAL8 chi_eff = XLALSimIMRPhenomBComputeChi(mBH, mNS, chi_BH, 0.0);
905  BBHPhenomCParams *params = ComputeIMRPhenomCParams(mBH, mNS, chi_eff, NULL);
906  if (!params)
908  if (params->g1 < 0.0)
909  params->g1 = 0.0;
910  if (params->del1 < 0.0)
911  params->del1 = 0.0;
912  if (params->del2 < 0.0)
913  params->del2 = 0.0;
914  BBHPhenomNSBHParams *NSBH_params = ComputeIMRPhenomNSBHParams(mBH, mNS, chi_BH, lambda_NS, params);
915  if (!NSBH_params)
916  XLAL_ERROR(XLAL_EFAULT, "PhenomNSBH properties was returned as a NULL pointer");
917 
918  const double Mb = XLALSimIMRPhenomNSBH_baryonic_mass_from_C(NSBH_params->C, mNS);
919 
920  *f_RD = NSBH_params->f_RD / M_sec;
921  *f_tide = NSBH_params->f_tide / M_sec;
922  *torus_mass = NSBH_params->Mtorus * Mb * LAL_MSUN_SI;
923  *compactness = NSBH_params->C;
924  *final_mass = NSBH_params->final_mass * LAL_MSUN_SI * (mBH + mNS);
925  *chif = NSBH_params->chif;
926 
927  if (params)
928  XLALFree(params);
929  if (NSBH_params)
930  XLALFree(NSBH_params);
931 
932  return XLAL_SUCCESS;
933 }
934 
935 /** @} */
936 
937 /** @} */
938 
939 /** @} */
940 
941 /** @} */
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
int XLALSimNRTunedTidesFDTidalPhaseFrequencySeries(const REAL8Sequence *phi_tidal, const REAL8Sequence *amp_tidal, const REAL8Sequence *planck_taper, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2, NRTidal_version_type NRTidal_version)
Function to call the frequency domain tidal correction over an array of input frequencies.
static REAL8 wPlus(const REAL8 f, const REAL8 f0, const REAL8 d, const BBHPhenomCParams *params)
static REAL8 wMinus(const REAL8 f, const REAL8 f0, const REAL8 d, const BBHPhenomCParams *params)
static BBHPhenomCParams * ComputeIMRPhenomCParams(const REAL8 m1, const REAL8 m2, const REAL8 chi, LALDict *extraParams)
UsefulPowers powers_of_pi
useful powers of LAL_PI, calculated once and kept constant - to be initied with a call to init_useful...
Internal function for IMRPhenomD phenomenological waveform model. See LALSimIMRPhenom....
static void ComputeIMRPhenDPhaseConnectionCoefficients(IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
This function aligns the three phase parts (inspiral, intermediate and merger-rindown) such that they...
static double IMRPhenDPhase(double f, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, UsefulPowers *powers_of_f, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
This function computes the IMR phase given phenom coefficients.
static int init_phi_ins_prefactors(PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
static void ComputeIMRPhenomDPhaseCoefficients(IMRPhenomDPhaseCoefficients *p, double eta, double chi1, double chi2, double finspin, LALDict *extraParams)
A struct containing all the parameters that need to be calculated to compute the phenomenological pha...
static double Subtract3PNSS(double m1, double m2, double M, double eta, double chi1, double chi2)
Subtract 3PN spin-spin term below as this is in LAL's TaylorF2 implementation (LALSimInspiralPNCoeffi...
static double DPhiMRD(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm)
First frequency derivative of PhiMRDAnsatzInt Rholm was added when IMRPhenomHM (high mode) was added.
static int init_useful_powers(UsefulPowers *p, REAL8 number)
size_t PhenomInternal_NextPow2(const size_t n)
Return the closest higher power of 2.
void PhenomInternal_nudge(REAL8 *x, REAL8 X, REAL8 epsilon)
If x and X are approximately equal to relative accuracy epsilon then set x = X.
static BBHPhenomNSBHParams * ComputeIMRPhenomNSBHParams(const REAL8 m1, const REAL8 m2, const REAL8 chi, const REAL8 lambda, const BBHPhenomCParams *params)
PhenomC parameters for NSBH amplitude model.
int IMRPhenomNSBH_Core(COMPLEX16FrequencySeries **htilde, REAL8 phiRef, REAL8 fRef, REAL8 distance, REAL8 mBH_SI, REAL8 mNS_SI, REAL8 chi_BH, REAL8 chi_NS, LALDict *extraParams, const REAL8Sequence *freqs_in, REAL8 deltaF)
static REAL8 PhenomNSBHAmplitudeOneFrequency(const REAL8 f, const BBHPhenomCParams *params, const BBHPhenomNSBHParams *params_NSBH)
Computes PhenomNSBH Amplitude at a single frequency.
@ NON_DISRUPTIVE
@ MILDLY_DISRUPTIVE_NO_TORUS_REMNANT
@ MILDLY_DISRUPTIVE_TORUS_REMNANT
@ DISRUPTIVE
double XLALSimPhenomUtilsFDamp0(REAL8 Mtot_Msun, REAL8 distance)
compute the frequency domain amplitude pre-factor
int XLALSimInspiralSetQuadMonParamsFromLambdas(LALDict *LALparams)
if you do NOT provide a quadparam[1,2] term and you DO provide lamdba[1,2] then we calculate quad-mon...
static vector d(const double L_norm, const double J_norm, const vector roots)
Internal function that returns the coefficients "d_0", "d_2" and "d_4" from 1703.03967 corresponding ...
REAL8 XLALSimInspiralWaveformParamsLookupTidalLambda2(LALDict *params)
int XLALSimInspiralWaveformParamsInsertPNSpinOrder(LALDict *params, INT4 value)
REAL8 M
Definition: bh_qnmode.c:133
double i
Definition: bh_ringdown.c:118
double e
Definition: bh_ringdown.c:117
const double pn
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
#define LAL_MSUN_SI
#define LAL_PI
#define LAL_MTSUN_SI
#define LIGOTIMEGPSZERO
double complex COMPLEX16
double REAL8
uint32_t UINT4
void * XLALMalloc(size_t n)
void XLALFree(void *p)
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.
@ NRTidalv2_V
version NRTidalv2: https://arxiv.org/abs/1905.06011
Definition: LALSimIMR.h:82
int XLALSimIMRPhenomNSBHFrequencySequence(COMPLEX16FrequencySeries **htilde, const REAL8Sequence *freqs, REAL8 phiRef, REAL8 fRef, REAL8 distance, REAL8 mBH_SI, REAL8 mNS_SI, REAL8 chi_BH, REAL8 chi_NS, LALDict *extraParams)
Compute waveform in LAL format at specified frequencies for the IMRPhenomNSBH model.
double XLALSimIMRPhenomBComputeChi(const REAL8 m1, const REAL8 m2, const REAL8 s1z, const REAL8 s2z)
Compute the dimensionless, spin-aligned parameter chi as used in the IMRPhenomB waveform.
int XLALSimIMRPhenomNSBH(COMPLEX16FrequencySeries **htilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 mBH_SI, REAL8 mNS_SI, REAL8 chi_BH, REAL8 chi_NS, LALDict *extraParams)
Driver routine to compute the single-spin, non-precessing, neutron-star-black-hole,...
double XLALSimIMRPhenomNSBH_sigma_tide_with_torus_mass(const REAL8 Mtorus, const REAL8 C, const REAL8 q, const REAL8 chi)
Correction to ringdown Lorentzian width for disruptive mergers.
double XLALSimIMRPhenomNSBH_sigma_tide_ND(const REAL8 x_ND_prime)
Correction to ringdown Lorentzian width for nondisruptive mergers.
double XLALSimIMRPhenomNSBH_x_D(const REAL8 Mtorus, const REAL8 C, const REAL8 q, const REAL8 chi)
Convenience function for expression appearing in disruptive merger.
double XLALSimIMRPhenomNSBH_x_ND_prime(const REAL8 f_tide, const REAL8 f_RD_tilde, const REAL8 C, const REAL8 chi)
Convinience function for expression appearing in disruptive merger.
double XLALSimIMRPhenomNSBH_baryonic_mass_from_C(const REAL8 C, const REAL8 Mg)
NS baryonic mass as a function of NS gravitational mass.
double XLALSimIMRPhenomNSBH_window_minus(const REAL8 f, const REAL8 f0, const REAL8 d)
Hyperbolic tangent sigmoid function.
double XLALSimIMRPhenomNSBH_window_plus(const REAL8 f, const REAL8 f0, const REAL8 d)
Hyperbolic tangent sigmoid function.
double XLALSimIMRPhenomNSBH_x_ND(const REAL8 f_tide, const REAL8 f_RD_tilde, const REAL8 C, const REAL8 chi)
Convinience function for expression appearing in disruptive merger.
double XLALSimIMRPhenomNSBH_eta_from_q(const REAL8 q)
Convenience function to calculate symmetric mass ratio from q.
int XLALSimIMRPhenomNSBHProperties(REAL8 *f_RD, REAL8 *f_tide, REAL8 *torus_mass, REAL8 *compactness, REAL8 *final_mass, REAL8 *chif, REAL8 mBH_SI, REAL8 mNS_SI, REAL8 chi_BH, REAL8 lambda_NS)
COMPLEX16 XLALSimIMRPhenomNSBH_omega_tilde(const REAL8 a)
220 quasi-normal mode dimensionless frequency
double XLALSimIMRPhenomNSBH_epsilon_ins_with_torus_mass(const REAL8 Mtorus, const REAL8 C, const REAL8 q, const REAL8 chi)
Correction to the inspiral transition frequency with spin contributions.
double XLALSimIMRPhenomNSBH_epsilon_tide_ND(const REAL8 x_ND)
PhenomC parameter delta_1 NSBH correction factor.
double XLALSimIMRPhenomNSBH_delta2_prime(const REAL8 f_tide, const REAL8 f_RD_tilde)
Fitted coefficient for PhenomC Lorentzian.
double XLALSimIMRPhenomNSBH_x_D_prime(const REAL8 Mtorus, const REAL8 C, const REAL8 q, const REAL8 chi)
Convinience function for expression appearing in disruptive merger.
@ LAL_SIM_INSPIRAL_SPIN_ORDER_35PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_ALL
int XLALSimInspiralTaylorF2AlignedPhasing(PNPhasingSeries **pfa, const REAL8 m1, const REAL8 m2, const REAL8 chi1, const REAL8 chi2, LALDict *extraPars)
Returns structure containing TaylorF2 phasing coefficients for given physical parameters.
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.
static const INT4 q
static const INT4 a
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
const LALUnit lalStrainUnit
const LALUnit lalSecondUnit
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
#define XLAL_ERROR_NULL(...)
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFAULT
XLAL_EFUNC
XLAL_EDOM
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
list p
list mu
string status
Structure holding all coefficients for the phase.
used to cache the recurring (frequency-independent) prefactors of PhiInsAnsatzInt.
REAL8 * data
useful powers in GW waveforms: 1/6, 1/3, 2/3, 4/3, 5/3, 2, 7/3, 8/3, -1, -1/6, -7/6,...
Definition: burst.c:245
double f_min
Definition: unicorn.c:22
double f_max
Definition: unicorn.c:23