26 #include <lal/FrequencySeries.h>
27 #include <lal/LALConstants.h>
28 #include <lal/LALDatatypes.h>
29 #include <lal/LALSimInspiral.h>
30 #include <lal/Units.h>
31 #include <lal/XLALError.h>
40 typedef struct tagLALSimInspiralSF2Orientation
47 typedef struct tagLALSimInspiralSF2Coeffs
85 if (val1 == 0. && val2 == 0.)
88 {
return atan2(val1, val2); }
97 orientation->
v_ref = v_ref;
98 const REAL8 chi1 = sqrt(s1x*s1x+s1y*s1y+s1z*s1z);
99 orientation->
chi = chi1;
100 orientation->
kappa = (chi1 > 0.) ? (lnhatx*s1x+lnhaty*s1y+lnhatz*s1z)/chi1 : 1.;
101 const REAL8 Jx0 = m1*m2*lnhatx/v_ref + m1*m1*s1x;
102 const REAL8 Jy0 = m1*m2*lnhaty/v_ref + m1*m1*s1y;
103 const REAL8 Jz0 = m1*m2*lnhatz/v_ref + m1*m1*s1z;
104 const REAL8 thetaJ = acos(Jz0 / sqrt(Jx0*Jx0+Jy0*Jy0+Jz0*Jz0));
105 orientation->
thetaJ = thetaJ;
107 orientation->
psiJ = psiJ;
110 const REAL8 rotLx = lnhatx*cos(thetaJ)*cos(psiJ) - lnhaty*cos(thetaJ)*sin(psiJ) + lnhatz*sin(thetaJ);
111 const REAL8 rotLy = lnhatx*sin(psiJ) + lnhaty*cos(psiJ);
119 const REAL8 quadparam = 1.;
122 const REAL8 mtot = m1+m2;
124 const REAL8 eta = m1*m2/(mtot*mtot);
126 const REAL8 gamma0 = m1*chi/m2;
127 coeffs->
kappa = kappa;
131 const REAL8 pn_beta = (113.*m1/(12.*mtot) - 19.*eta/6.)*chi*kappa;
132 const REAL8 pn_sigma = ( (5.*quadparam*(3.*kappa*kappa-1.)/2.)
133 + (7. - kappa*kappa)/96. )
134 * (m1*m1*chi*chi/mtot/mtot);
135 const REAL8 pn_gamma = (5.*(146597. + 7056.*eta)*m1/(2268.*mtot)
136 - 10.*eta*(1276. + 153.*eta)/81.)*chi*kappa;
138 coeffs->
prec_fac = 5.*(4. + 3.*m2/m1)/64.;
139 const REAL8 dtdv2 = 743./336. + 11.*eta/4.;
141 const REAL8 dtdv4 = 3058673./1016064. + 5429.*eta/1008. + 617.*eta*eta/144. - pn_sigma;
142 const REAL8 dtdv5 = (-7729./672.+13.*eta/8.)*
LAL_PI + 9.*pn_gamma/40.;
144 coeffs->
aclog1 = kappa*(1.-kappa*kappa)*gamma0*gamma0*gamma0/2.-dtdv2*kappa*gamma0-dtdv3;
145 coeffs->
aclog2 = dtdv2*gamma0+dtdv3*kappa+(1.-kappa*kappa)*(dtdv4-dtdv5*kappa/gamma0)/gamma0/2.;
146 coeffs->
ac[0] = -1./3.;
147 coeffs->
ac[1] = -gamma0*kappa/6.;
148 coeffs->
ac[2] = gamma0*gamma0*(-1./3.+kappa*kappa/2.) - dtdv2;
149 coeffs->
ac[3] = dtdv3+dtdv4*kappa/gamma0/2.+dtdv5*(1./3.-kappa*kappa/2.)/gamma0/gamma0;
150 coeffs->
ac[4] = dtdv4/2.+dtdv5*kappa/gamma0/6.;
151 coeffs->
ac[5] = dtdv5/3.;
153 coeffs->
zc[0] = -1./3.;
154 coeffs->
zc[1] = -gamma0*kappa/2.;
155 coeffs->
zc[2] = -dtdv2;
156 coeffs->
zc[3] = dtdv2*gamma0*kappa+dtdv3;
157 coeffs->
zc[4] = dtdv3*gamma0*kappa+dtdv4;
158 coeffs->
zc[5] = (dtdv4*gamma0*kappa+dtdv5)/2.;
159 coeffs->
zc[6] = dtdv5*gamma0*kappa/3.;
168 const REAL8 sqrtfac = sqrt(1. + 2.*kappa*gam + gam*gam);
169 const REAL8 logfac1 = log((1. + kappa*gam + sqrtfac)/v);
170 const REAL8 logfac2 = log(kappa + gam + sqrtfac);
176 return coeffs.
prec_fac * (aclog1*logfac1 + aclog2*logfac2 \
177 + (((ac[0]/v+ac[1])/v+ac[2])/v + ac[3] \
178 + (ac[4]+ac[5]*v)*v)*sqrtfac );
182 static REAL8 XLALSimInspiralSF2Zeta(
187 return coeffs.
prec_fac*(((zc[0]/v+zc[1])/v+zc[2])/v + zc[3]*log(v) + \
188 (zc[4]+(zc[5]+zc[6]*v)*v)*v);
191 static REAL8 XLALSimInspiralSF2Beta(
211 plus_fac = (1.+cos(thetaJ)*cos(thetaJ))/2.;
212 cross_fac = -1.j*cos(thetaJ);
215 plus_fac = sin(2.*thetaJ);
216 cross_fac = -2.j*sin(thetaJ);
219 plus_fac = 3.*sin(thetaJ)*sin(thetaJ);
223 plus_fac = -sin(2.*thetaJ);
224 cross_fac = -2.j*sin(thetaJ);
227 plus_fac = (1.+cos(thetaJ)*cos(thetaJ))/2.;
228 cross_fac = 1.j*cos(thetaJ);
235 return plus_fac*cos(2.*psiJ) + cross_fac*sin(2.*psiJ);
245 const REAL8 sqrtfac = sqrt(1. + 2.*kappa*gam + gam*gam);
246 const REAL8 cosbeta = (1. + kappa*gam)/sqrtfac;
247 const REAL8 sinbeta = (kappa_perp*gam)/sqrtfac;
249 emission[0] = (1.+cosbeta)*(1.+cosbeta)/4.;
250 emission[1] = (1.+cosbeta)*sinbeta/4.;
251 emission[2] = sinbeta*sinbeta/4.;
252 emission[3] = (1.-cosbeta)*sinbeta/4.;
253 emission[4] = (1.-cosbeta)*(1.-cosbeta)/4.;
308 const INT4 amplitudeO
316 const REAL8 eta = m1 * m2 / (
m *
m);
318 const REAL8 vISCO = 1. / sqrt(6.);
319 const REAL8 fISCO = vISCO * vISCO * vISCO / piM;
327 const REAL8 v_ref = f_ref > 0. ? cbrt(piM*f_ref) : cbrt(piM*fStart);
330 COMPLEX16 prec_plus, prec_cross, phasing_fac;
331 bool enable_precession =
true;
339 enable_precession = orientation.
chi != 0. && orientation.
kappa != 1. && orientation.
kappa != -1.;
348 for(mm = -2; mm <= 2; mm++)
356 memset(SBplus, 0, 5 *
sizeof(
COMPLEX16));
357 memset(SBcross, 0, 5 *
sizeof(
COMPLEX16));
364 const REAL8 chi1sq = orientation.
chi*orientation.
chi;
381 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
387 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
393 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
398 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
403 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
408 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
413 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
426 if (enable_precession)
472 n = (size_t) (
f_max / deltaF + 1);
490 iStart = (size_t) ceil(fStart / deltaF);
495 REAL8 ref_phasing = 0.;
498 const REAL8 logvref = log(v_ref);
499 const REAL8 v2ref = v_ref * v_ref;
500 const REAL8 v3ref = v_ref * v2ref;
501 const REAL8 v4ref = v_ref * v3ref;
502 const REAL8 v5ref = v_ref * v4ref;
503 ref_phasing = (pfaN + pfa1 * v_ref +pfa2 * v2ref + pfa3 * v3ref + pfa4 * v4ref) / v5ref + (pfa5 + pfl5 * logvref) + (pfa6 + pfl6 * logvref) * v_ref + pfa7 * v2ref + pfa8 * v3ref;
506 #pragma omp parallel for
507 for (
i = iStart;
i < n;
i++) {
508 const REAL8 f =
i * deltaF;
509 const REAL8 v = cbrt(piM*f);
510 const REAL8 logv = log(v);
511 const REAL8 v2 = v * v;
512 const REAL8 v3 = v * v2;
513 const REAL8 v4 = v * v3;
514 const REAL8 v5 = v * v4;
515 REAL8 phasing = (pfaN + pfa1*v + pfa2 * v2 + pfa3 * v3 + pfa4 * v4) / v5 + (pfa5 + pfl5 * logv) + (pfa6 + pfl6 * logv) * v + pfa7 * v2 + pfa8 * v3;
522 prec_plus = SBplus[0]*emission[0]*
u*
u
523 + SBplus[1]*emission[1]*
u
524 + SBplus[2]*emission[2]
525 + SBplus[3]*emission[3]/
u
526 + SBplus[4]*emission[4]/
u/
u;
527 prec_cross= SBcross[0]*emission[0]*
u*
u
528 + SBcross[1]*emission[1]*
u
529 + SBcross[2]*emission[2]
530 + SBcross[3]*emission[3]/
u
531 + SBcross[4]*emission[4]/
u/
u;
533 phasing += shft * f - 2.*phi_ref - ref_phasing -
LAL_PI_4;
534 phasing_fac = cos(phasing) - 1.0j*sin(phasing);
535 data_plus[
i] = amp * prec_plus * phasing_fac;
536 data_cross[
i] = amp * prec_cross * phasing_fac;
540 *hcross_out = hcross;
static double beta(const double a, const double b, const sysq *system)
Internal function that computes the spin-orbit couplings.
static REAL8 UNUSED XLALSimInspiralPNFlux_0PNCoeff(REAL8 eta)
Computes the flux PN Coefficients.
static REAL8 UNUSED XLALSimInspiralPNEnergy_0PNCoeff(REAL8 eta)
Computes the PN Coefficients for using in the PN energy equation.
static void UNUSED XLALSimInspiralPNPhasing_F2(PNPhasingSeries *pfa, const REAL8 m1, const REAL8 m2, const REAL8 chi1L, const REAL8 chi2L, const REAL8 chi1sq, const REAL8 chi2sq, const REAL8 chi1dotchi2, LALDict *p)
static REAL8 safe_atan2(REAL8 val1, REAL8 val2)
static void XLALSimInspiralSF2CalculateOrientation(LALSimInspiralSF2Orientation *orientation, REAL8 m1, REAL8 m2, REAL8 v_ref, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 s1x, REAL8 s1y, REAL8 s1z)
static void XLALSimInspiralSF2Emission(REAL8 *emission, REAL8 v, LALSimInspiralSF2Coeffs coeffs)
static REAL8 XLALSimInspiralSF2Alpha(REAL8 v, LALSimInspiralSF2Coeffs coeffs)
static void XLALSimInspiralSF2CalculateCoeffs(LALSimInspiralSF2Coeffs *coeffs, REAL8 m1, REAL8 m2, REAL8 chi, REAL8 kappa)
static COMPLEX16 XLALSimInspiralSF2Polarization(REAL8 thetaJ, REAL8 psiJ, int mm)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
int XLALSimInspiralSpinTaylorF2(COMPLEX16FrequencySeries **hplus_out, COMPLEX16FrequencySeries **hcross_out, const REAL8 phi_ref, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 s1x, const REAL8 s1y, const REAL8 s1z, const REAL8 lnhatx, const REAL8 lnhaty, const REAL8 lnhatz, const REAL8 fStart, const REAL8 fEnd, const REAL8 f_ref, const REAL8 r, LALDict *moreParams, const INT4 phaseO, const INT4 amplitudeO)
Computes the stationary phase approximation to the Fourier transform of a chirp waveform with phase g...
const LALUnit lalStrainUnit
const LALUnit lalSecondUnit
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 vlogv[PN_PHASING_SERIES_MAX_ORDER+1]
REAL8 v[PN_PHASING_SERIES_MAX_ORDER+1]