26 #include <gsl/gsl_errno.h>
27 #include <gsl/gsl_spline.h>
28 #include <gsl/gsl_poly.h>
50 XLAL_CHECK(mBH_SI <= 100.0*mNS_SI,
XLAL_EDOM,
"Mass ratio must be less than or equal to 100");
52 XLALPrintWarning(
"IMRPhenomNSBH is not calibrated for a non-zero NS spin\n");
60 XLALPrintError(
"(*htilde) is supposed to be NULL, but got %p", (*htilde));
79 LALDict *extraParams_in = extraParams;
91 REAL8 eta = mBH * mNS / (
M *
M);
94 if (eta > 0.25 || eta < 0.0)
98 XLALPrintWarning(
"IMRPhenomNSBH is not calibrated for a NS mass less than 1\n");
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);
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);
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);
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);
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);
147 for (
UINT4 i = iStart;
i < iStop;
i++)
148 freqs->
data[
i - iStart] =
i * deltaF;
153 n_full = freqs_in->
length;
156 XLAL_CHECK(*htilde,
XLAL_ENOMEM,
"Failed to allocated waveform COMPLEX16FrequencySeries of length %zu from sequence.", n_full);
167 memset((*htilde)->data->data, 0, n_full *
sizeof(
COMPLEX16));
181 if (extraParams == NULL)
200 const REAL8 MfRef = M_sec * fRef;
207 const REAL8 phi_precalc = 2. * phiRef + phi0;
218 phi_tidal, amp_tidal, planck_taper, freqs,
223 const REAL8 ylm_fac = 2. * sqrt(5. / (64. *
LAL_PI));
228 double fHz = freqs->
data[
i];
229 double Mf = M_sec * fHz;
236 XLALPrintError(
"init_useful_powers failed for Mf, status_in_for=%d", status_in_for);
244 phi += phi_tidal->
data[
i] - t0 * (Mf - MfRef) - phi_precalc;
245 ((*htilde)->data->data)[j] = amp0 * amp * cexp(-I * phi) * ylm_fac;
253 if (extraParams && !extraParams_in)
310 xdot *= (
params->xdotaN * v10);
312 if (xdot < 0.0 && f < params->f1)
314 XLALPrintError(
"omegaDot < 0, while frequency is below SPA-PM matching freq.");
323 REAL8 omgdot = 1.5 * v * xdot;
332 aPN = sqrt(AmpPNre * AmpPNre + AmpPNim * AmpPNim);
340 Mfrd = params_NSBH->
f_RD;
341 sig2 = params_NSBH->
sigma * params_NSBH->
sigma;
343 REAL8 L = sig2 / ((Mf - Mfrd) * (Mf - Mfrd) + sig2 / 4.);
348 REAL8 wMinusf0_PN = 0.0;
349 REAL8 wMinusf0_PM = 0.0;
356 REAL8 amp = -(aPN * wMinusf0_PN + aPM * wMinusf0_PM + aRD * wPlusf0);
387 const REAL8 MBH = m1;
388 const REAL8 MNS = m2;
402 const REAL8 Mtot = MBH + MNS;
408 p->f_RD = creal(omega_tilde)/2.0/
LAL_PI/
p->final_mass;
413 const REAL8 rtide = xi * (1.0 - 2.0 *
p->C) /
mu;
415 p->q_factor = creal(omega_tilde)/cimag(omega_tilde)/2.0;
422 const REAL8 f_RD_tilde = 0.99 * 0.98 *
p->f_RD;
425 const REAL8 lambda2 = lambda*lambda;
427 p->gamma_correction = 1.25;
429 p->gamma_correction = 1.0 + 0.5*lambda - 0.25*lambda2;
436 p->delta_2_prime =
params->del2 - 2*c_2*lambda + c_2*lambda2;
438 p->sigma =
p->delta_2_prime *
p->f_RD /
p->q_factor;
441 if (
p->f_tide <
p->f_RD)
444 p->epsilon_tide = 0.0;
447 if (
p->epsilon_ins > 1.)
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;
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;
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;
475 p->sigma_tide = (
p->sigma_tide + sigma_tide_ND) / 2.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;
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;
507 p->epsilon_ins = 1.0;
611 phiRef, fRef, distance, mBH_SI, mNS_SI, chi_BH, chi_NS, extraParams, freqs, 0);
646 freqs->
data[0] = fLow;
647 freqs->
data[1] = fHigh;
650 phiRef, fRef, distance, mBH_SI, mNS_SI, chi_BH, chi_NS, extraParams, freqs, deltaF);
689 return Mtorus + 0.424912*C + 0.363604*sqrt(nu) - 0.0605591*chi;
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);
764 const REAL8 x_ND_prime
777 const REAL8 f_RD_tilde,
781 return pow((f_tide - f_RD_tilde)/f_RD_tilde, 2.0) - 0.571505*C - 0.00508451*chi;
792 const REAL8 f_RD_tilde,
796 return pow((f_tide - f_RD_tilde)/f_RD_tilde, 2.0) - 0.657424*C - 0.0259977*chi;
806 const REAL8 f_RD_tilde
823 return 0.25*(1 + tanh(4.0*(f-f0)/
d));
838 return 0.25*(1 - tanh(4.0*(f-f0)/
d));
847 return q/pow(1.0+
q, 2.0);
863 return Mg + Mg*(d1*C + d2*pow(C,2.0));
875 REAL8 kappa = pow(log(2-
a)/log(3), 0.5);
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)));
920 *f_RD = NSBH_params->
f_RD / M_sec;
921 *f_tide = NSBH_params->
f_tide / M_sec;
923 *compactness = NSBH_params->
C;
925 *chif = NSBH_params->
chif;
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.
@ MILDLY_DISRUPTIVE_NO_TORUS_REMNANT
@ MILDLY_DISRUPTIVE_TORUS_REMNANT
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 ...
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void * XLALMalloc(size_t n)
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
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.
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_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
Structure holding all coefficients for the phase.
used to cache the recurring (frequency-independent) prefactors of PhiInsAnsatzInt.
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,...