22 #include <lal/LALSimInspiral.h>
23 #include <lal/Units.h>
24 #include <lal/XLALError.h>
25 #include <lal/LALSimInspiralTestGRParams.h>
28 #define EPSILON 1.e-11
34 if (fabs(val1 - val2) >
EPSILON)
50 if (fabs(val1 - val2) >
EPSILON)
52 if (log_order == 0) {
fprintf(stderr,
"FAILED at %.1f PN order: %.11f versus %.11f\n", 0.5*v_order, val1, val2); }
53 else {
fprintf(stderr,
"FAILED at %.1f PN order, in log^%u term: %.11f versus %.11f\n", 0.5*v_order, log_order, val1, val2); }
88 static REAL8 pfac(
int n) {
return 40./(n-5.)/(n-8.); }
93 REAL8 temp = (n-5.)*(n-8.);
94 return 40.*(13.-2.*n)/temp/temp;
107 ret +=
compare(phasing->
v[5], (-40./9.)*dtdv->
v[5], 5, 0);
108 ret +=
compare(phasing->
vlogv[5], (-40./3.)*dtdv->
v[5], 5, 1);
124 for (
int j=1; j < k; j++)
126 accum += arr1[j]*arr2[k-j];
138 for (
int j=1; j < k; j++)
140 accum += (1.+((double) j)/2.)*ene[j]*wdot[k-j];
177 REAL8 S1L = m1M*m1M*chi1;
178 REAL8 S2L = m2M*m2M*chi2;
209 for (
int i = 2;
i < 8;
i++)
211 dtdv->
v[
i] = (1.+0.5*((double)
i))*energy[
i] - flux[
i] -
sum(flux, dtdv->
v,
i);
213 dtdv->
vlogv[6] = -flux6l;
228 dtdv->
v[4] += 3.*energy_ss4 - flux_ss4;
248 dtdv->
v[6] += 4.*energy_ss6 - flux_ss6 -3.*flux[2]*energy_ss4 - 2.*flux_ss4*energy[2] + 2.*flux[2]*flux_ss4;
265 REAL8 S1L = m1M*m1M*chi1;
266 REAL8 S2L = m2M*m2M*chi2;
299 const REAL8 m2M=1.-m1M;
300 const REAL8 eta=m1M*m2M;
304 printf(
"Testing consistency between averaged and instantaneous coefficients (2 and 3PN spin^2)\n");
350 fprintf(stdout,
"\n=== Testing eta=%.4f, chi1=%.4f, chi2=%.4f, qm1=%.4f, qm2=%.4f ===\n", eta, chi1, chi2, qm_def1, qm_def2);
364 chi1*chi1, chi2*chi2, chi1*chi2,\
369 REAL8 phase0 = phasing.
v[0];
372 phasing.
v[
i] /= phase0;
373 phasing.
vlogv[
i] /= phase0;
377 fprintf(stdout,
"Testing dtdv consistency with energy and flux.\n");
380 fprintf(stdout,
"Testing phasing consistency with dtdv.\n");
381 ret +=
compare(phasing.
v[0], 3./20.*dtdv_pn.
v[0], 0, 0);
384 fprintf(stdout,
"Testing phasing consistency with energy and flux.\n");
385 ret +=
compare(phasing.
v[0], 3./20.*dtdv_ef.
v[0], 0, 0);
421 REAL8 S1L = m1M*m1M*chi1;
422 REAL8 S2L = m2M*m2M*chi2;
448 energy[3] += energy_so3;
450 energy[5] += energy_so5;
463 for (
int i = 2;
i <8;
i++)
465 wdot->
v[
i] = flux[
i] - (1.+0.5*
i)*energy[
i] -
sumE(energy, wdot->
v,
i);
483 wdot->
v[4] += flux_ss4 -3.*energy_ss4;
503 wdot->
v[6] += flux_ss6 - 4.*energy_ss6 -3.*flux[2]*energy_ss4 - 2.*flux_ss4*energy[2] + 12.*energy[2]*energy_ss4;
520 REAL8 S1L = m1M*m1M*chi1;
521 REAL8 S2L = m2M*m2M*chi2;
573 fprintf(stdout,
"\n=== Testing T4 eta=%.4f, chi1=%.4f, chi2=%.4f, qm1=%.4f, qm2=%.4f ===\n", eta, chi1, chi2, qm_def1, qm_def2);
581 fprintf(stdout,
"Testing wdot consistency with energy and flux.\n");
605 REAL8 dtdv2 = 2.L*energy2 - flux2;
606 REAL8 dtdv10 = 6.L*energy10 - flux10;
607 REAL8 dtdv12 = (7.L*energy12 - flux12) - flux2*dtdv10 - flux10*dtdv2;
609 REAL8 calc_phasing10 = 4.L*dtdv10;
610 REAL8 calc_phasing12 = (10.L/7.L)*dtdv12;
616 ret +=
compare(calc_phasing10, phasing10, 10, 0);
617 ret +=
compare(calc_phasing12, phasing12, 12, 0);
636 REAL8 dvdt2 = flux2 - 2.L*energy2;
637 REAL8 dvdt10 = flux10 - 6.L*energy10;
638 REAL8 dvdt12 = (flux12 -7.L*energy12) - 2.L*energy2*dvdt10 - 6.L*energy10*dvdt2;
644 ret +=
compare(dvdt10, phasing10, 10, 0);
645 ret +=
compare(dvdt12, phasing12, 12, 0);
664 REAL8 dtdv2 = 2.L*energy2 - flux2;
665 REAL8 dtdv10 = 6.L*energy10 - flux10;
666 REAL8 dtdv12 = (7.L*energy12 - flux12) - flux2*dtdv10 - flux10*dtdv2;
672 ret +=
compare(dtdv10, phasing10, 10, 0);
673 ret +=
compare(dtdv12, phasing12, 12, 0);
693 dL1->
v[0] = 0.; dL2->
v[0] = 0.;
694 dL1->
v[1] = 0.; dL2->
v[1] = 0.;
695 dL1->
v[2] = 0.; dL2->
v[2] = 0.;
726 dL1->
v[0] = 0.; dL2->
v[0] = 0.;
727 dL1->
v[1] = 0.; dL2->
v[1] = 0.;
728 dL1->
v[2] = 0.; dL2->
v[2] = 0.;
753 fprintf(stdout,
"\n=== Testing dL eta=%.4f ===\n", eta);
761 fprintf(stdout,
"Testing dL consistency with dS.\n");
762 for (idx=0;idx<9;idx++) {
763 ret +=
compare(dL1_dL.
v[idx], dL1_dS.
v[idx],idx,0);
764 ret +=
compare(dL2_dL.
v[idx], dL2_dS.
v[idx],idx,0);
771 int main (
int argc,
char **argv)
811 fprintf(stdout,
"Testing tidal terms.\n");
812 for (
UINT4 idx=1;idx<=9;idx++) {
819 for (
UINT4 idx=1;idx<=5;idx++) {
825 fprintf(stdout,
"\nAll PNCoefficients tests passed.\n");
829 fprintf(stderr,
"\nFAILURE: %u PNCoefficients comparisons incorrect.\n", ret);
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNQMS1vS1vCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_5PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1S2CoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_7PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_0PNCoeff(REAL8 eta)
Computes the flux PN Coefficients.
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_7PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_10PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_3PNCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_5PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1nS2nCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNS1S2CoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_3PNCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_0PNCoeff(REAL8 eta)
Computes the PN Coefficients for using in the TaylorT4 frequency equation.
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_7PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNS1S2CoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNS1OS2OCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_7PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_0PNCoeff(REAL8 eta)
Computes the PN Coefficients for using in the PN energy equation.
static REAL8 UNUSED XLALSimInspiralPNFlux_10PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNS1OS1OCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1OS2OCoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralLDot_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNQMS1nS1nCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNLogCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralLDot_7PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNQMS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_7PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNQMS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_10PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNLogCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNQMS1nS1nCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1OS2OCoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1S2CoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNQMS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNS1OS1OCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNS1OS2OCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_7PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNS1nS2nCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralSpinDot_3PNCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_7PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNS1OS2OCoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1vS2vCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNQMS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNS1OS2OCoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNS1OS2OCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralSpinDot_7PNCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNQMS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNLogCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNQMS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNQMS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_0PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralSpinDot_5PNCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNS1vS1vCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_5PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNQMS1S1Coeff(REAL8 mByM)
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 UNUSED XLALSimInspiralPNEnergy_6PNS1OS1OCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_10PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_3PNCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralTaylorF2Phasing_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNQMS1S1Coeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNQMS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNS1OS2OCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_8PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNS1OS1OCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNS1S2Coeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralLDot_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT2dtdv_4PNS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNFlux_8PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorF2Phasing_10PNTidalCoeff(REAL8 mByM)
static int test_consistency_dL(const REAL8 m1M)
static void dtdv_from_energy_flux(PNPhasingSeries *dtdv, const REAL8 m1M, const REAL8 chi1, const REAL8 chi2, const REAL8 qm_def1, const REAL8 qm_def2)
static int compare(REAL8 val1, REAL8 val2, int v_order, int log_order)
static int compare_value(REAL8 val1, REAL8 val2)
static int test_average(const REAL8 m1M)
static void dL_from_dSpncoefficients(PNPhasingSeries *dL1, PNPhasingSeries *dL2, const REAL8 m1M)
static void dL_from_pncoefficients(PNPhasingSeries *dL1, PNPhasingSeries *dL2, const REAL8 m1M)
static int test_consistency(const REAL8 m1M, const REAL8 chi1, const REAL8 chi2, const REAL8 qm_def1, const REAL8 qm_def2)
static int test_tidal_T4(const REAL8 m2M)
int main(int argc, char **argv)
static void T4wdot_from_pncoefficients(PNPhasingSeries *wdot, const REAL8 m1M, const REAL8 chi1, const REAL8 chi2, const REAL8 qm_def1, const REAL8 qm_def2)
static REAL8 sum(REAL8 *arr1, REAL8 *arr2, int k)
static REAL8 logpfac(int n)
static int test_tidal_F2(const REAL8 m2M)
static void T4wdot_from_energy_flux(PNPhasingSeries *wdot, const REAL8 m1M, const REAL8 chi1, const REAL8 chi2, const REAL8 qm_def1, const REAL8 qm_def2)
static void dtdv_from_pncoefficients(PNPhasingSeries *dtdv, const REAL8 m1M, const REAL8 chi1, const REAL8 chi2, const REAL8 qm_def1, const REAL8 qm_def2)
static REAL8 sumE(REAL8 *ene, REAL8 *wdot, int k)
static int compare_phasing_to_dtdv(PNPhasingSeries *phasing, PNPhasingSeries *dtdv)
static int compare_pnseries(PNPhasingSeries *s1, PNPhasingSeries *s2)
static int test_consistency_T4(const REAL8 m1M, const REAL8 chi1, const REAL8 chi2, const REAL8 qm_def1, const REAL8 qm_def2)
static int test_tidal_T2(const REAL8 m2M)
#define PN_PHASING_SERIES_MAX_ORDER
Structure for passing around PN phasing coefficients.
REAL8 vlogv[PN_PHASING_SERIES_MAX_ORDER+1]
REAL8 vlogvsq[PN_PHASING_SERIES_MAX_ORDER+1]
REAL8 v[PN_PHASING_SERIES_MAX_ORDER+1]