33 #include <gsl/gsl_math.h>
46 REAL8 eta2 = (eta*eta);
47 REAL8 eta3 = (eta2*eta);
48 REAL8 eta4 = (eta3*eta);
57 REAL8 noSpin, eqSpin, uneqSpin;
59 REAL8 dchi = chi1L - chi2L;
60 REAL8 dchi2 = (dchi*dchi);
63 noSpin = (0.018744340279608845 + 0.0077903147004616865*eta + 0.003940354686136861*eta2 - 0.00006693930988501673*eta3)/(1. - 0.10423384680638834*eta);
65 eqSpin = (S*(0.00027180386951683135 - 0.00002585252361022052*S + eta4*(-0.0006807631931297156 + 0.022386313074011715*S - 0.0230825153005985*S2) + eta2*(0.00036556167661117023 - 0.000010021140796150737*S - 0.00038216081981505285*S2) + eta*(0.00024422562796266645 - 0.00001049013062611254*S - 0.00035182990586857726*S2) + eta3*(-0.0005418851224505745 + 0.000030679548774047616*S + 4.038390455349854e-6*S2) - 0.00007547517256664526*S2))/(0.026666543809890402 + (-0.014590539285641243 - 0.012429476486138982*eta + 1.4861197211952053*eta4 + 0.025066696514373803*eta2 + 0.005146809717492324*eta3)*S + (-0.0058684526275074025 - 0.02876774751921441*eta - 2.551566872093786*eta4 - 0.019641378027236502*eta2 - 0.001956646166089053*eta3)*S2 + (0.003507640638496499 + 0.014176504653145768*eta + 1.*eta4 + 0.012622225233586283*eta2 - 0.00767768214056772*eta3)*S3);
67 uneqSpin = dchi2*(0.00034375176678815234 + 0.000016343732281057392*eta)*eta2 + dchi*
delta*eta*(0.08064665214195679*eta2 + eta*(-0.028476219509487793 - 0.005746537021035632*S) - 0.0011713735642446144*S);
69 return (noSpin + eqSpin + uneqSpin);
77 REAL8 OmegaISCO, rISCO;
78 REAL8 rISCOsq, rISCO3o2;
81 Z1 = 1.0 + cbrt( (1.0 - chif*chif) ) * ( cbrt(1 + chif) + cbrt(1 - chif) );
83 Z2 = sqrt(3.0*chif*chif + Z1*Z1);
86 rISCOsq = sqrt(rISCO);
87 rISCO3o2 = rISCOsq * rISCOsq * rISCOsq;
89 OmegaISCO = 1.0 / ( rISCO3o2 + chif);
108 REAL8 eta2 = eta*eta;
109 REAL8 eta3 = eta2*eta;
110 REAL8 eta4 = eta3*eta;
116 REAL8 dchi = chi1L - chi2L;
117 REAL8 dchi2 = dchi*dchi;
119 REAL8 noSpin, eqSpin, uneqSpin;
121 noSpin = 0.057190958417936644*eta + 0.5609904135313374*eta2 - 0.84667563764404*eta3 + 3.145145224278187*eta4;
124 eqSpin = ((0.057190958417936644*eta + 0.5609904135313374*eta2 - 0.84667563764404*eta3 + 3.145145224278187*eta4)*
126 + (-0.13084389181783257 - 1.1387311580238488*eta + 5.49074464410971*eta2)*S
127 + (-0.17762802148331427 + 2.176667900182948*eta2)*S2
128 + (-0.6320191645391563 + 4.952698546796005*eta - 10.023747993978121*eta2)*S3))
129 / (1 + (-0.9919475346968611 + 0.367620218664352*eta + 4.274567337924067*eta2)*S);
131 eqSpin = eqSpin - noSpin;
133 uneqSpin = - 0.09803730445895877*dchi*
delta*(1 - 3.2283713377939134*eta)*eta2
134 + 0.01118530335431078*dchi2*eta3
135 - 0.01978238971523653*dchi*
delta*(1 - 4.91667749015812*eta)*eta*S;
137 return (noSpin + eqSpin + uneqSpin);
147 REAL8 eta2 = eta*eta;
148 REAL8 eta3 = eta2*eta;
149 REAL8 eta4 = eta3*eta;
155 REAL8 dchi = chi1L - chi2L;
156 REAL8 dchi2 = dchi*dchi;
158 REAL8 noSpin, eqSpin, uneqSpin;
160 noSpin = 0.057190958417936644*eta + 0.5609904135313374*eta2 - 0.84667563764404*eta3 + 3.145145224278187*eta4;
163 eqSpin = ((0.057190958417936644*eta + 0.5609904135313374*eta2 - 0.84667563764404*eta3 + 3.145145224278187*eta4)*
165 + (-0.13084389181783257 - 1.1387311580238488*eta + 5.49074464410971*eta2)*S
166 + (-0.17762802148331427 + 2.176667900182948*eta2)*S2
167 + (-0.6320191645391563 + 4.952698546796005*eta - 10.023747993978121*eta2)*S3))
168 / (1 + (-0.9919475346968611 + 0.367620218664352*eta + 4.274567337924067*eta2)*S);
170 eqSpin = eqSpin - noSpin;
172 uneqSpin = - 0.09803730445895877*dchi*
delta*(1 - 3.2283713377939134*eta)*eta2
173 + 0.01118530335431078*dchi2*eta3
174 - 0.01978238971523653*dchi*
delta*(1 - 4.91667749015812*eta)*eta*S;
177 return (1.0 - (noSpin + eqSpin + uneqSpin));
193 REAL8 eta2 = eta*eta;
194 REAL8 eta3 = eta2*eta;
201 REAL8 dchi = chi1L - chi2L;
202 REAL8 dchi2 = dchi*dchi;
204 REAL8 noSpin, eqSpin, uneqSpin;
206 noSpin = (3.4641016151377544*eta + 20.0830030082033*eta2 - 12.333573402277912*eta3)/(1 + 7.2388440419467335*eta);
208 eqSpin = (m1Sq + m2Sq)*S
209 + ((-0.8561951310209386*eta - 0.09939065676370885*eta2 + 1.668810429851045*eta3)*S
210 + (0.5881660363307388*eta - 2.149269067519131*eta2 + 3.4768263932898678*eta3)*S2
211 + (0.142443244743048*eta - 0.9598353840147513*eta2 + 1.9595643107593743*eta3)*S3)
212 / (1 + (-0.9142232693081653 + 2.3191363426522633*eta - 9.710576749140989*eta3)*S);
214 uneqSpin = 0.3223660562764661*dchi*
delta*(1 + 9.332575956437443*eta)*eta2
215 - 0.059808322561702126*dchi2*eta3
216 + 2.3170397514509933*dchi*
delta*(1 - 3.2624649875884852*eta)*eta3*S;
219 return (noSpin + eqSpin + uneqSpin);
229 const REAL8 chi_inplane
232 REAL8 m1 = 0.5 * (1.0 + sqrt(1 - 4.0*eta));
233 REAL8 m2 = 0.5 * (1.0 - sqrt(1 - 4.0*eta));
238 REAL8 af_parallel, q_factor;
248 REAL8 Sperp = chi_inplane * q_factor * q_factor;
249 REAL8 af = copysign(1.0, af_parallel) * sqrt(Sperp*Sperp + af_parallel*af_parallel);
262 REAL8 chi_eff = (mm1*chi1L + mm2*chi2L);
264 return chi_eff - (38.0/113.0)*eta*(chi1L + chi2L);
275 REAL8 chi_eff = (mm1*chi1L + mm2*chi2L);
277 return (chi_eff - (38.0/113.0)*eta*(chi1L + chi2L) ) / (1.0 - (76.0*eta/113.0));
289 return (mm1*chi1L + mm2*chi2L);
303 return ((m1s * chi1L + m2s * chi2L) / (m1s + m2s));
311 return chi1L - chi2L;
350 double eta2 = eta*eta;
351 double eta3 = eta2*eta;
358 double noSpin, eqSpin, uneqSpin;
360 noSpin = (1.0691011796680957e7 + 1.185905809135487e6*eta)/(1. + 30289.726104019595*eta);
362 eqSpin = (3590.4466629551066 - 43200.79177912654*eta +
363 200094.57177252226*eta2 - 319307.42983118095*eta3)*S +
364 eta*(-1108.7615587239336 + 25622.545977741574*eta -
365 83180.15680637326*eta2)*S3 + (379.0250508368122 -
366 1355.868129015304*eta)*eta2*S4 + (-23306.844979169644 +
367 91977.08490230633*eta)*eta2*S5 + (-204.5064259069199 + 1046.9991525832384*eta - 5906.920781540527*eta3)*S2;
369 uneqSpin = 44.87175399132858*dchi*
delta*eta;
371 return (noSpin + eqSpin + uneqSpin) +
LAL_PI;
380 double eta2,eta3,eta4,S2,S3,S4;
387 double noSpin = 13.39320482758057 - 175.42481512989315*eta + 2097.425116152503*eta2 - 9862.84178637907*eta3 + 16026.897939722587*eta4;
388 double eqSpin = (4.7895602776763 - 163.04871764530466*eta + 609.5575850476959*eta2)*S + (1.3934428041390161 - 97.51812681228478*eta + 376.9200932531847*eta2)*S2 + (15.649521097877374 + 137.33317057388916*eta - 755.9566456906406*eta2)*S3 + (13.097315867845788 + 149.30405703643288*eta - 764.5242164872267*eta2)*S4;
389 double uneqSpin = 105.37711654943146*dchi*sqrt(1. - 4.*eta)*eta2;
390 return( noSpin + eqSpin + uneqSpin);
403 double eta2 = eta*eta;
404 double eta3= eta2*eta, eta4= eta3*eta, eta5=eta3*eta2, eta6=eta4*eta2;
408 double noSpin = 3155.1635543201924 + 1257.9949740608242*eta - 32243.28428870599*eta2 + 347213.65466875216*eta3 - 1.9223851649491738e6*eta4 + 5.3035911346921865e6*eta5 - 5.789128656876938e6*eta6;
409 double eqSpin = (-24.181508118588667 + 115.49264174560281*eta - 380.19778216022763*eta2)*S + (24.72585609641552 - 328.3762360751952*eta + 725.6024119989094*eta2)*S2 + (23.404604124552 - 646.3410199799737*eta + 1941.8836639529036*eta2)*S3 + (-12.814828278938885 - 325.92980012408367*eta + 1320.102640190539*eta2)*S4;
410 double uneqSpin = -148.17317525117338*dchi*
delta*eta2;
413 return (noSpin + eqSpin + uneqSpin);
424 return !gsl_fcmp(
x,
y, epsilon);
439 if (fabs(
x - X) < epsilon)
447 if (fabs(
a) < tol && fabs(b) < tol)
458 return (
size_t) pow(2,ceil(log2(n)));
467 return (
x > 0.) ? 1.0 : ((
x < 0.0) ? -1.0 : 0.0);
477 return (number*number);
485 return (number*number*number);
503 return pow2 * pow2 * number;
512 return pow2 * pow2 * pow2;
521 return pow2 * pow2 * pow2 * number;
530 double pow4 = pow2*pow2;
540 double pow4 = pow2*pow2;
541 return pow4 * pow4 * number;
558 REAL8 m1_tmp, m2_tmp;
559 REAL8 chi1x_tmp, chi1y_tmp, chi1z_tmp;
560 REAL8 chi2x_tmp, chi2y_tmp, chi2z_tmp;
605 XLAL_ERROR(
XLAL_EDOM,
"An error occured in XLALIMRPhenomXPCheckMassesAndSpins when trying to enfore that m1 should be the larger mass.\
606 After trying to enforce this m1 = %f and m2 = %f\n", *m1, *m2);
622 REAL8 invf = 1.0 / ff;
623 REAL8 invf2 = invf * invf;
624 REAL8 invf3 = invf2 * invf;
626 REAL8 logfv = log(ff);
630 phaseOut = ( a0*ff + a1*logfv -
a2*invf - (
a4 * invf3 / 3.0) + (aL * atan( (ff - fRD)/fDA ) / fDA ) );
648 REAL8 invf = 1.0 / ff;
649 REAL8 invf2 = invf * invf;
651 REAL8 invf4 = invf2 * invf2;
655 phaseOut = ( a0 + a1*invf +
a2*invf2 +
a4*invf4 + ( aL / (fDA*fDA + (ff - fRD)*(ff - fRD)) ) );
666 REAL8 gammaD13 = fDA * gamma1 * gamma3;
667 REAL8 gammaR = gamma2 / (gamma3 * fDA);
668 REAL8 gammaD2 = (fDA * gamma3) * (fDA * gamma3);
669 REAL8 dfr = ff - fRD;
672 ampOut = exp(- dfr * gammaR ) * (gammaD13) / (dfr*dfr + gammaD2);
686 return ff7o6 / ( a0 + ff*(a1 + ff*(
a2 + ff*(a3 + ff*(
a4 + ff*a5)))) );
698 REAL8 invff1 = 1.0 / ff;
699 REAL8 invff2 = invff1 * invff1;
700 REAL8 invff3 = invff2 * invff1;
701 REAL8 invff4 = invff3 * invff1;
703 REAL8 LorentzianTerm;
707 LorentzianTerm = (4.0 * aL) / ( (4.0*fDA*fDA) + (ff - fRD)*(ff - fRD) );
710 phaseOut = a0 + a1*invff1 +
a2*invff2 + a3*invff3 +
a4*invff4 + LorentzianTerm;
719 ampOut = sqrt(2.0/3.0) * sqrt(eta) / pow(
LAL_PI,1.0/6.0);
741 if (fabs(af) > 1.0) {
743 function: |finalDimlessSpin| > 1.0 not supported");
753 return_val = (0.05947169566573468 - \
754 0.14989771215394762*af + 0.09535606290986028*x2 + \
755 0.02260924869042963*x3 - 0.02501704155363241*x4 - \
756 0.005852438240997211*x5 + 0.0027489038393367993*x6 + \
757 0.0005821983163192694*x7)/(1 - 2.8570126619966296*af + \
758 2.373335413978394*x2 - 0.6036964688511505*x4 + \
759 0.0873798215084077*x6);
775 if (fabs(af) > 1.0) {
777 function: |finalDimlessSpin| > 1.0 not supported");
786 return_val = (0.014158792290965177 - \
787 0.036989395871554566*af + 0.026822526296575368*x2 + \
788 0.0008490933750566702*x3 - 0.004843996907020524*x4 - \
789 0.00014745235759327472*x5 + 0.0001504546201236794*x6)/(1 - \
790 2.5900842798681376*af + 1.8952576220623967*x2 - \
791 0.31416610693042507*x4 + 0.009002719412204133*x6);
798 for (
int i = 1;
i < len;
i++) {
799 double d = in[
i] - in[
i-1];
800 d =
d > M_PI ?
d - 2 * M_PI : (
d < -M_PI ?
d + 2 * M_PI :
d);
801 out[
i] = out[
i-1] +
d;
static double double delta
REAL8 XLALSimIMRPhenomXfMECO(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Phenomenological fit to hybrid minimum energy circular orbit (MECO) function.
void IMRPhenomX_InternalNudge(REAL8 x, REAL8 X, REAL8 epsilon)
If x and X are approximately equal to relative accuracy epsilon then set x = X.
REAL8 XLALSimIMRPhenomXFinalMass2017(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Final Mass = 1 - Energy Radiated, X Jimenez-Forteza et al, PRD, 95, 064024, (2017),...
bool IMRPhenomX_ApproxEqual(REAL8 x, REAL8 y, REAL8 epsilon)
This function determines whether x and y are approximately equal to a relative accuracy epsilon.
REAL8 XLALSimIMRPhenomXErad2017(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Energy Radiated: X Jimenez-Forteza et al, PRD, 95, 064024, (2017), arXiv:1611.00332.
REAL8 XLALSimIMRPhenomXfring22(const REAL8 af)
Ringdown frequency for 22 mode, given final dimensionless spin.
void XLALSimIMRPhenomXUnwrapArray(double *in, double *out, int len)
Function to unwrap a time series that contains an angle, to obtain a continuous time series.
REAL8 XLALSimIMRPhenomXRingdownPhaseDeriv22AnsatzAnalytical(REAL8 ff, REAL8 fRD, REAL8 fDA, REAL8 a0, REAL8 a1, REAL8 a2, REAL8 a4, REAL8 aL)
"Analytical" phenomenological ringdown ansatz for phase derivative.
INT4 XLALIMRPhenomXPCheckMassesAndSpins(REAL8 *m1, REAL8 *m2, REAL8 *chi1x, REAL8 *chi1y, REAL8 *chi1z, REAL8 *chi2x, REAL8 *chi2y, REAL8 *chi2z)
Check if m1 > m2.
REAL8 XLALSimIMRPhenomXRingdownPhase22AnsatzAnalytical(REAL8 ff, REAL8 fRD, REAL8 fDA, REAL8 a0, REAL8 a1, REAL8 a2, REAL8 a4, REAL8 aL)
"Analytical" phenomenological ringdown ansatz for phase.
double pow_9_of(double number)
calc ninth power of number without floating point 'pow'
REAL8 XLALSimIMRPhenomXfISCO(REAL8 chif)
Fitting function for hybrid minimum energy circular orbit (MECO) function.
REAL8 XLALSimIMRPhenomXFinalSpin2017(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Final Dimensionless Spin, X Jimenez-Forteza et al, PRD, 95, 064024, (2017), arXiv:1611....
bool IMRPhenomX_StepFuncBool(const double t, const double t1)
REAL8 XLALSimIMRPhenomXIntermediateAmplitude22AnsatzAnalytical(REAL8 ff, REAL8 ff7o6, REAL8 a0, REAL8 a1, REAL8 a2, REAL8 a3, REAL8 a4, REAL8 a5)
double pow_4_of(double number)
calc fourth power of number without floating point 'pow'
REAL8 XLALSimIMRPhenomXatan2tol(REAL8 a, REAL8 b, REAL8 tol)
REAL8 XLALSimIMRPhenomXRingdownAmplitude22AnsatzAnalytical(REAL8 ff, REAL8 fRD, REAL8 fDA, REAL8 gamma1, REAL8 gamma2, REAL8 gamma3)
"Analytical" phenomenological ringdown ansatz for amplitude.
REAL8 XLALSimIMRPhenomXUtilsHztoMf(REAL8 fHz, REAL8 Mtot_Msun)
Convert from frequency in Hz to geometric frequency.
double pow_3_of(double number)
calc cube of number without floating point 'pow'
double pow_8_of(double number)
calc eigth power of number without floating point 'pow'
REAL8 XLALSimIMRPhenomXsign(REAL8 x)
REAL8 XLALSimIMRPhenomXUtilsMftoHz(REAL8 Mf, REAL8 Mtot_Msun)
Convert from geometric frequency to Hz.
REAL8 XLALSimIMRPhenomXPrecessingFinalSpin2017(const REAL8 eta, const REAL8 chi1L, const REAL8 chi2L, const REAL8 chi_inplane)
Wrapper for the final spin in generically precessing binary black holes.
REAL8 XLALSimIMRPhenomXSTotR(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Total spin normalised to [-1,1].
double pow_7_of(double number)
calc seventh power of number without floating point 'pow'
REAL8 XLALSimIMRPhenomXdchi(REAL8 chi1L, REAL8 chi2L)
Spin difference.
double pow_5_of(double number)
calc fifth power of number without floating point 'pow'
REAL8 XLALSimIMRPhenomXLina(REAL8 eta, REAL8 S, REAL8 dchi, REAL8 delta)
We apply a linear time and phase shift to ~ align peak LinShift = (PNLina[ ] + + f PNLinb[ ]); Linea...
REAL8 XLALSimIMRPhenomXIntermediatePhase22AnsatzAnalytical(REAL8 ff, REAL8 fRD, REAL8 fDA, REAL8 a0, REAL8 a1, REAL8 a2, REAL8 a3, REAL8 a4, REAL8 aL)
REAL8 XLALSimIMRPhenomXfdamp22(const REAL8 af)
Damping frequency for 22 mode, given final dimensionless spin.
REAL8 XLALSimIMRPhenomXPsi4ToStrain(double eta, double S, double dchi)
This is a fit of the time-difference between t_peak of strain and t_peak of psi4 needed to align in t...
double pow_6_of(double number)
calc sixth power of number without floating point 'pow'
size_t NextPow2(const size_t n)
REAL8 XLALSimIMRPhenomXchiPNHat(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Normalised PN reduced spin parameter.
REAL8 XLALSimIMRPhenomXLinb(REAL8 eta, REAL8 S, REAL8 dchi, REAL8 delta)
double pow_2_of(double number)
calc square of number without floating point 'pow'
REAL8 XLALSimIMRPhenomXchiPN(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
PN reduced spin parameter.
REAL8 XLALSimIMRPhenomXchiEff(REAL8 eta, REAL8 chi1L, REAL8 chi2L)
Effective aligned spin parameter.
REAL8 XLALSimIMRPhenomXAmp22Prefactor(REAL8 eta)
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 ...
#define XLAL_PRINT_INFO(...)