36 #include <gsl/gsl_vector.h>
37 #include <gsl/gsl_matrix.h>
38 #include <gsl/gsl_spline.h>
39 #include <gsl/gsl_linalg.h>
43 #ifndef _LALSIMIMRNQCCORRECTION_C
44 #define _LALSIMIMRNQCCORRECTION_C
47 #define UNUSED __attribute__ ((unused))
82 return 10.67 - 2.5 + 9.0 * eta - 41.41 * eta + 76.1 * eta * eta;
92 return 3.383 + 3.847 * eta + 8.979 * eta * eta;
102 return 5.57 - 49.86 * eta + 154.3 * eta * eta;
112 return 6.693 - 34.47 * eta + 102.7 * eta * eta;
141 return eta * (1.422 + 0.3013 * eta + 1.246 * eta * eta);
145 return eta * sqrt (1.0 - 4. * eta) * (0.4832 - 0.01032 * eta);
155 return eta * sqrt (1. - 4. * eta) * (0.5761 - 0.09638 * eta +
166 return eta * (0.354 - 1.779 * eta + 2.834 * eta * eta);
176 return eta * sqrt (1. - 4. * eta) * (0.1353 - 0.1485 * eta);
205 return -0.01 * eta * (0.1679 + 1.44 * eta - 2.001 * eta * eta);
209 return -0.01 * eta * sqrt (1. - 4. * eta) * (0.1867 + 0.6094 * eta);
219 return -0.01 * eta * sqrt (1. - 4. * eta) * (0.2518 - 0.8145 * eta +
230 return -0.01 * eta * (0.1813 - 0.9935 * eta + 1.858 * eta * eta);
240 return -0.01 * eta * sqrt (1. - 4. * eta) * (0.09051 -
271 return 0.2733 + 0.2316 * eta + 0.4463 * eta * eta;
275 return 0.2907 - 0.08338 * eta + 0.587 * eta * eta;
285 return 0.4539 + 0.5376 * eta + 1.042 * eta * eta;
295 return 0.6435 - 0.05103 * eta + 2.216 * eta * eta;
305 return 0.8217 + 0.2346 * eta + 2.599 * eta * eta;
334 return 0.005862 + 0.01506 * eta + 0.02625 * eta * eta;
338 return 0.00149 + 0.09197 * eta - 0.1909 * eta * eta;
348 return 0.01074 + 0.0293 * eta + 0.02066 * eta * eta;
358 return 0.01486 + 0.08529 * eta - 0.2174 * eta * eta;
368 return 0.01775 + 0.09801 * eta - 0.1686 * eta * eta;
403 if (
l != 2 ||
m != 2)
412 memset (coeffs, 0,
sizeof (*coeffs));
414 coeffs->
a1 = -4.55919 + 18.761 * eta - 24.226 * eta * eta;
415 coeffs->
a2 = 37.683 - 201.468 * eta + 324.591 * eta * eta;
416 coeffs->
a3 = -39.6024 + 228.899 * eta - 387.222 * eta * eta;
438 REAL8 rOmega, rOmegaSq;
450 rOmegaSq = rOmega * rOmega;
456 mag = 1. + (
p *
p / rOmegaSq) * (coeffs->a1
457 + coeffs->a2 /
r + (coeffs->a3 +
460 + coeffs->a4 / (
r *
r) +
461 coeffs->a5 / (
r *
r * sqrtR));
463 phase = coeffs->b1 *
p / rOmega +
p *
p *
p / rOmega * (coeffs->b2
468 *nqc = mag * cos (phase);
469 *nqc += I * mag * sin (phase);
498 REAL8 rOmega, rOmegaSq;
505 sqrt (values->data[0] * values->data[0] +
506 values->data[1] * values->data[1] +
507 values->data[2] * values->data[2]);
509 (values->data[0] * values->data[3] + values->data[1] * values->data[4] +
510 values->data[2] * values->data[5]) /
r;
515 rOmegaSq = rOmega * rOmega;
520 mag = 1. + (
p *
p / rOmegaSq) * (coeffs->a1
521 + coeffs->a2 /
r + (coeffs->a3 +
524 + coeffs->a4 / (
r *
r) +
525 coeffs->a5 / (
r *
r * sqrtR));
527 phase = coeffs->b1 *
p / rOmega +
p *
p *
p / rOmega * (coeffs->b2
532 *nqc = mag * cos (phase);
533 *nqc += I * mag * sin (phase);
583 REAL8 omega, omegaDot;
586 REAL8 nromega, nromegaDot;
588 REAL8 nrDeltaT, nrTimePeak;
591 gsl_spline *spline = NULL;
592 gsl_interp_accel *acc = NULL;
595 gsl_matrix *qMatrix = NULL, *pMatrix = NULL;
596 gsl_vector *aCoeff = NULL, *bCoeff = NULL;
598 gsl_vector *amps = NULL, *omegaVec = NULL;
600 gsl_permutation *perm1 = NULL, *perm2 = NULL;
614 for (
i = 0;
i < timeVec->length;
i++)
617 q1LM->
data[
i] =
q1->data[
i] * amplitude->data[
i];
618 q2LM->
data[
i] =
q2->data[
i] * amplitude->data[
i];
619 q3LM->
data[
i] =
q3->data[
i] * amplitude->data[
i];
625 qMatrix = gsl_matrix_alloc (3, 3);
626 aCoeff = gsl_vector_alloc (3);
627 amps = gsl_vector_alloc (3);
628 perm1 = gsl_permutation_alloc (3);
630 pMatrix = gsl_matrix_alloc (2, 2);
631 bCoeff = gsl_vector_alloc (2);
632 omegaVec = gsl_vector_alloc (2);
633 perm2 = gsl_permutation_alloc (2););
635 if (!qMatrix || !aCoeff || !amps || !pMatrix || !bCoeff || !omegaVec)
637 gsl_matrix_free (qMatrix);
638 gsl_vector_free (amps);
639 gsl_vector_free (aCoeff);
640 gsl_permutation_free (perm1);
641 gsl_matrix_free (pMatrix);
642 gsl_vector_free (omegaVec);
643 gsl_vector_free (bCoeff);
644 gsl_permutation_free (perm2);
664 nrTimePeak = timePeak + nrDeltaT;
667 spline = gsl_spline_alloc (gsl_interp_cspline, amplitude->length);
668 acc = gsl_interp_accel_alloc ();
671 gsl_spline_init (spline, timeVec->data, q1LM->
data, q1LM->
length);
672 gsl_matrix_set (qMatrix, 0, 0, gsl_spline_eval (spline, nrTimePeak, acc));
673 gsl_matrix_set (qMatrix, 1, 0,
674 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
675 gsl_matrix_set (qMatrix, 2, 0,
676 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
679 gsl_spline_init (spline, timeVec->data, q2LM->
data, q2LM->
length);
680 gsl_interp_accel_reset (acc);
681 gsl_matrix_set (qMatrix, 0, 1, gsl_spline_eval (spline, nrTimePeak, acc));
682 gsl_matrix_set (qMatrix, 1, 1,
683 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
684 gsl_matrix_set (qMatrix, 2, 1,
685 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
688 gsl_spline_init (spline, timeVec->data, q3LM->
data, q3LM->
length);
689 gsl_interp_accel_reset (acc);
690 gsl_matrix_set (qMatrix, 0, 2, gsl_spline_eval (spline, nrTimePeak, acc));
691 gsl_matrix_set (qMatrix, 1, 2,
692 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
693 gsl_matrix_set (qMatrix, 2, 2,
694 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
697 gsl_spline_init (spline, timeVec->data, amplitude->data, amplitude->length);
698 gsl_interp_accel_reset (acc);
699 a = gsl_spline_eval (spline, nrTimePeak, acc);
700 aDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
701 aDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
715 gsl_vector_set (amps, 0, nra -
a);
716 gsl_vector_set (amps, 1, -aDot);
717 gsl_vector_set (amps, 2, nraDDot - aDDot);
721 gsl_linalg_LU_decomp (qMatrix, perm1, &signum);
722 gsl_linalg_LU_solve (qMatrix, perm1, amps, aCoeff);
727 gsl_spline_init (spline, timeVec->data, p1->data, p1->length);
728 gsl_interp_accel_reset (acc);
729 gsl_matrix_set (pMatrix, 0, 0,
730 -gsl_spline_eval_deriv (spline, nrTimePeak, acc));
731 gsl_matrix_set (pMatrix, 1, 0,
732 -gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
735 gsl_spline_init (spline, timeVec->data, p2->data, p2->length);
736 gsl_interp_accel_reset (acc);
737 gsl_matrix_set (pMatrix, 0, 1,
738 -gsl_spline_eval_deriv (spline, nrTimePeak, acc));
739 gsl_matrix_set (pMatrix, 1, 1,
740 -gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
743 gsl_spline_init (spline, timeVec->data, phase->data, phase->length);
744 gsl_interp_accel_reset (acc);
745 omega = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
746 omegaDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
749 if (omega * omegaDot > 0.0)
751 omega = fabs (omega);
752 omegaDot = fabs (omegaDot);
756 omega = fabs (omega);
757 omegaDot = -fabs (omegaDot);
772 gsl_vector_set (omegaVec, 0, nromega - omega);
773 gsl_vector_set (omegaVec, 1, nromegaDot - omegaDot);
776 gsl_linalg_LU_decomp (pMatrix, perm2, &signum);
777 gsl_linalg_LU_solve (pMatrix, perm2, omegaVec, bCoeff);
780 coeffs->a1 = gsl_vector_get (aCoeff, 0);
781 coeffs->a2 = gsl_vector_get (aCoeff, 1);
782 coeffs->a3 = gsl_vector_get (aCoeff, 2);
783 coeffs->b1 = gsl_vector_get (bCoeff, 0);
784 coeffs->b2 = gsl_vector_get (bCoeff, 1);
787 gsl_matrix_free (qMatrix);
788 gsl_vector_free (amps);
789 gsl_vector_free (aCoeff);
790 gsl_permutation_free (perm1);
792 gsl_matrix_free (pMatrix);
793 gsl_vector_free (omegaVec);
794 gsl_vector_free (bCoeff);
795 gsl_permutation_free (perm2);
797 gsl_spline_free (spline);
798 gsl_interp_accel_free (acc);
817 UNUSED
static inline REAL8
843 1.77 *
a *
a *
a *
a / (0.43655 * 0.43655 * 0.43655 *
848 (1.0 - 2.0 * eta) / (1.0 - 2.0 * eta));
860 XLALPrintError (
"XLAL Error %s - We should never get here!!\n", __func__);
868 UNUSED
static inline REAL8
872 REAL8 chi =
a, chi2 = chi * chi, chi3 = chi * chi2;
873 REAL8 eta2 = eta * eta;
877 res = eta * (56.28859370276537 * (-0.1858184673895021 +
878 eta) * (0.18616944529501114 + eta) -
879 155.11365222671776 * chi3 * (-0.25025223669804486 +
880 eta) * (0.23614334403451426 +
882 322.4309641674941 * chi2 * (-0.24986765309607953 +
883 eta) * (0.24802475468124208 +
885 226.09242469439047 * chi * (-0.24993985462384588 +
886 eta) * (0.2573225045218015 +
891 res = eta * (1.449934273310975 +
892 3.8867234144877933 * chi * (-0.26967339454732164 +
893 eta) * (-0.15977862405445659 +
895 2.2705573440821687 * chi2 * (-0.20039719578235954 +
896 eta) * (-0.06130397389190033 +
898 8.094119513915285 * chi3 * (-0.2598144292071539 +
899 eta) * (-0.010564809220517786 +
901 0.019756052721845246 * eta + 1.933934833691488 * eta2);
914 REAL8 eta2 = eta * eta;
916 A0 = -0.00099601593625498 * A1 - 0.00001600025600409607 * fEQ + 1.000016000256004 * fTPL;
917 A2 = -3.984063745019967 * A1 + 16.00025600409607 * fEQ - 16.0002560041612 * fTPL;
919 return A0 + A1 * eta + A2 * eta2;
928 UNUSED
static inline REAL8
932 REAL8 eta = (m1 * m2) / ((m1 + m2) * (m1 + m2));
933 REAL8 dM = sqrt(1.-4.*eta);
943 REAL8 eta2 = eta*eta;
944 REAL8 chi = chiS + chiA * (m1 - m2) / (m1 + m2) / (1. -
947 REAL8 chi21 = chiS*dM/(1.-1.3*eta) + chiA;
948 REAL8 chi33 = chiS*dM + chiA;
949 REAL8 chi44 = chiS*(1-5*eta) + chiA*dM;
950 REAL8 chi2 = chi * chi, chi3 = chi * chi2;
952 REAL8 fTPL, fEQ, A1, e0, e1, e2, e3;
958 fTPL = 1.4528573105413543 + 0.16613449160880395 * chi + 0.027355646661735258 * chi2 - 0.020072844926136438 * chi3;
960 fEQ = 1.577457498227 - 0.0076949474494639085 * chi + 0.02188705616693344 * chi2 + 0.023268366492696667 * chi3;
962 e0 = -0.03442402416125921;
963 e1 = -1.218066264419839;
964 e2 = -0.5683726304811634;
965 e3 = 0.4011143761465342;
966 A1 = e0 + e1 * chi + e2 * chi2 + e3 * chi3;
971 res = -((0.29256703361640224-0.19710255145276584*eta)*eta*chi21 + dM*eta*(-0.42817941710649793 + 0.11378918021042442*eta-0.7736772957051212*eta2
972 +chi21*chi21*(0.047004057952214004 - eta*0.09326128322462478)) +dM*eta*chi21*(-0.010195081244587765 + 0.016876911550777807*chi21*chi21));
977 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
986 res = (0.10109183988848384*eta - 0.4704095462146807*eta2 + 1.0735457779890183*eta2*eta)*chi33 +
987 dM*(0.5636580081367962*eta - 0.054609013952480856*eta2 + 2.3093699480319234*eta2*eta + chi33*chi33*(0.029812986680919126*eta - 0.09688097244145283*eta2) );
991 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1000 res = eta*(0.2646580063832686 + 0.067584186955327*chi44 +0.02925102905737779*chi44*chi44) + eta2 *(-0.5658246076387973 -0.8667455348964268*chi44 +0.005234192027729502*chi44*chi44)
1001 + eta*eta2*(-2.5008294352355405 + 6.880772754797872*chi44 -1.0234651570264885*chi44*chi44) + eta2*eta2*(7.6974501716202735 -16.551524307203252*chi44);
1004 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1013 res = 0.128621*dM *eta -0.474201 *dM *eta*eta +1.0833 * dM *eta*eta*eta + 0.0322784 * eta * chi33 -0.134511 *chi33 *eta * eta +0.0990202 *chi33*eta*eta*eta;
1018 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1025 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1039 UNUSED
static inline REAL8
1044 REAL8 eta = (m1 * m2) / ((m1 + m2) * (m1 + m2));
1045 REAL8 dM = sqrt(1.-4.*eta);
1056 REAL8 eta2 = eta*eta;
1057 REAL8 chi21 = chiS*dM/(1.-2.*eta) + chiA;
1058 REAL8 chi33 = chiS*dM + chiA;
1059 REAL8 chi44 = chiS*(1-7*eta) + chiA*dM;
1068 res = dM*eta*(0.007147528020812309-eta*0.035644027582499495) + dM*eta*chi21*(-0.0087785131749995 + eta*0.03054672006241107) + eta*0.00801714459112299*fabs(-dM*(0.7875612917853588 + eta*1.161274164728927 + eta2*11.306060006923605)+chi21);
1072 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1080 res = dM*eta*(-0.00309943555972098 + eta*0.010076527264663805)*chi33*chi33 +
1082 eta*0.0016309606446766923*sqrt(dM2*(8.811660714437027 + 104.47752236009688*eta) + dM*chi33*(-5.352043503655119 + eta*49.68621807460999) + chi33*chi33);
1085 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1093 res = eta*(0.004347588211099233 -0.0014612210699052148*chi44 -0.002428047910361957*chi44*chi44) + eta2*(0.023320670701084355-0.02240684127113227*chi44+0.011427087840231389*chi44*chi44)+
1094 eta*eta2*(-0.46054477257132803 + 0.433526632115367*chi44) + eta2*eta2*(1.2796262150829425-1.2400051122897835*chi44);
1097 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1106 res = eta * (dM*(-0.008389798844109389 + 0.04678354680410954*eta) + dM*chi33*(-0.0013605616383929452 + 0.004302712487297126*eta) +dM*chi33*chi33*(-0.0011412109287400596 + 0.0018590391891716925*eta) +
1108 0.0002944221308683548*fabs(dM*(37.11125499129578 - 157.79906814398277*eta) + chi33));
1111 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1117 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1130 UNUSED
static inline REAL8
1138 res = eta * (0.04818855743392375 * chi * (-0.15271017198256195 +
1139 eta) * (0.2154794478856639 +
1141 0.038199344157345716 * (-0.06621184971565616 +
1142 eta) * (0.31317077454081577 +
1147 res = eta * (0.010916757595083287 * (-1.0608229327701018 +
1148 eta) * (0.19667724848989968 +
1150 0.007331284524315633 * chi * (-0.753628708015681 +
1151 eta) * (0.341046049832081 +
1153 chi * chi * (0.0006958660609341137 -
1154 0.01113385697494582 * eta * eta) +
1155 chi * chi * chi * (-0.00029607425270115136 +
1156 0.004737188043218422 * eta * eta));
1166 UNUSED
static inline REAL8
1170 REAL8 eta = (m1 * m2) / ((m1 + m2) * (m1 + m2));
1171 REAL8 dM = sqrt(1.-4.*eta);
1181 REAL8 eta2 = eta*eta;
1182 REAL8 chi21 = chiS*dM/(1.-2.*eta) + chiA;
1183 REAL8 chi = chiS + chiA * (m1 - m2) / (m1 + m2) / (1. -
1186 REAL8 chi33 = chiS*dM + chiA;
1187 REAL8 chiMinus1 = -1. + chi;
1189 REAL8 fTPL, fEQ, A1, e0, e1;
1195 fTPL = 0.002395610769995033 * chiMinus1 - 0.00019273850675004356 * chiMinus1 * chiMinus1 - 0.00029666193167435337 * chiMinus1 * chiMinus1 * chiMinus1;
1197 fEQ = -0.004126509071377509 + 0.002223999138735809 * chi;
1199 e0 = -0.005776537350356959;
1200 e1 = 0.001030857482885267;
1206 res = eta*dM*0.00037132201959950333 -
1207 fabs(dM*eta*(-0.0003650874948532221 - eta*0.003054168419880019)
1208 +dM*eta*chi21*chi21*(-0.0006306232037821514-eta*0.000868047918883389 + eta2*0.022306229435339213)+eta*chi21*chi21*chi21*0.0003402427901204342+dM*eta*chi21*0.00028398490492743);
1212 XLALPrintError(
"XLAL Error - %s: At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__);
1221 res = dM*eta*(0.0009605689249339088 - 0.00019080678283595965*eta)*chi33 - 0.00015623760412359145*eta*fabs(dM*(4.676662024170895 + 79.20189790272218*eta - 1097.405480250759*eta2 + 6512.959044311574*eta*eta2 -13263.36920919937*eta2*eta2) + chi33);
1224 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1232 res = eta*(-0.000301722928925693 + 0.0003215952388023551*chi) + eta2*(0.006283048344165004 + 0.0011598784110553046*chi) + eta2*eta*(-0.08143521096050622 - 0.013819464720298994*chi)+
1233 eta2*eta2*(0.22684871200570564 + 0.03275749240408555*chi);
1236 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1244 res = eta * (dM *(0.00012727220842255978 + 0.0003211670856771251*eta) + dM*chi33*(-0.00006621677859895541 + 0.000328855327605536*eta) + chi33*chi33*(-0.00005824622885648688 + 0.00013944293760663706*eta));
1248 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1255 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1268 UNUSED
static inline REAL8
1272 REAL8 eta2 = eta * eta, eta3 = eta * eta2;
1274 if (eta > 50. / 51. / 51.)
1276 res = 0.43747541927878864 + (-0.10933208665273314 -
1277 0.007325831113333813 * chi) *
1278 log (4.500844771420863 - 9.681916048928946 * eta +
1279 chi * (-4.254886879579986 + 11.513558950322647 * eta));
1283 res = 1.5609526077704716 - 122.25721149839733 * eta +
1284 3586.2192688666914 * eta2 -
1285 13869.506144441548 * eta3 + (-0.25 +
1286 eta) * (1651.5823693445805 *
1287 (-0.019223375977400495 +
1288 eta) * (-0.01922337527211892 +
1290 66.87492814925524 * chi *
1291 (0.0003695381704106058 -
1292 0.03844675124951941 * eta +
1293 eta2)) * log (5600.67382718678 -
1296 (-1412.8186461833657 + 67.66455403259023 * chi) * (-0.001 +
1298 (0.0003695381704106056 - 0.038446751249519406 * eta +
1299 eta2) * log (0.5680439481719505 - 0.36813967358200156 * chi) +
1300 0.012328326527732041 * log (4.500844771420863 -
1301 9.681916048928946 * eta +
1302 chi * (-4.254886879579986 +
1303 11.513558950322647 * eta)) +
1304 0.0008260634258180991 * chi * log (4.500844771420863 -
1305 9.681916048928946 * eta +
1306 chi * (-4.254886879579986 +
1307 11.513558950322647 * eta)) -
1308 12.6575493872956 * eta * log (4.500844771420863 -
1309 9.681916048928946 * eta +
1310 chi * (-4.254886879579986 +
1311 11.513558950322647 * eta)) -
1312 0.8481231078533651 * chi * eta * log (4.500844771420863 -
1313 9.681916048928946 * eta +
1314 chi * (-4.254886879579986 +
1315 11.513558950322647 *
1317 329.2228595635586 * eta2 * log (4.500844771420863 -
1318 9.681916048928946 * eta +
1319 chi * (-4.254886879579986 +
1320 11.513558950322647 * eta)) +
1321 22.05968203526603 * chi * eta2 * log (4.500844771420863 -
1322 9.681916048928946 * eta +
1323 chi * (-4.254886879579986 +
1324 11.513558950322647 *
1335 UNUSED
static inline REAL8
1338 REAL8 chi =
a, eta2 = eta*eta;
1346 c0 = 0.5626787200433265;
1347 c1 = -0.08706198756945482;
1348 c2 = 25.81979479453255;
1349 c3 = 25.85037751197443;
1351 d2 = 7.629921628648589;
1352 d3 = 10.26207326082448;
1354 A4 = d2 + 4 * (d2 -
c2) * (eta - 0.25);
1355 A3 = d3 + 4 * (d3 - c3) * (eta - 0.25);
1356 c4 = 0.00174345193125868;
1358 res =
c0 + (
c1 + c4 * chi) * log(A3 - A4 * chi);
1361 res = (0.1743194440996283 + eta*0.1938944514123048 + 0.1670063050527942*eta2 + 0.053508705425291826 *chi - eta*chi*0.18460213023455802 + eta2*chi*0.2187305149636044
1362 +chi*chi*0.030228846150378793 - eta*chi*chi*0.11222178038468673);
1365 XLALPrintError(
"XLAL Error - %s: At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__);
1374 res = 0.3973947703114506 + 0.16419332207671075*chi + 0.1635531186118689*chi*chi + 0.06140164491786984*chi*chi*chi+
1375 eta*(0.6995063984915486-0.3626744855912085*chi -0.9775469868881651*chi*chi)+ eta2*(-0.3455328417046369+0.31952307610699876*chi + 1.9334166149686984*chi*chi);
1378 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1386 res = 0.5389359134370971 + 0.16635177426821202*chi + 0.2075386047689103*chi*chi + 0.15268115749910835*chi*chi*chi +
1387 eta*(0.7617423831337586 + 0.009587856087825369*chi - 1.302303785053009*chi*chi - 0.5562751887042064*chi*chi*chi)
1388 + eta2*(0.9675153069365782 - 0.22059322127958586*chi + 2.678097398558074*chi*chi) - eta2*eta*4.895381222514275;
1391 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1399 res = 0.6437545281817488 + 0.22315530037902315*chi + 0.2956893357624277*chi*chi + 0.17327819169083758*chi*chi*chi +
1400 eta*(-0.47017798518175785 - 0.3929010618358481*chi - 2.2653368626130654*chi*chi - 0.5512998466154311*chi*chi*chi) +
1401 eta2*(2.311483807604238 + 0.8829339243493562*chi + 5.817595866020152*chi*chi);
1404 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1411 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1423 UNUSED
static inline REAL8
1426 REAL8 chi =
a, chi2=chi*chi, chi3=chi2*chi, chi4=chi2*chi2;
1427 REAL8 eta2 = eta*eta, eta3 = eta2*eta, eta4 = eta2*eta2;
1433 res = -1. * (5.89352329617707670906 * eta4
1434 + 3.75145580491965446868 * eta3 * chi
1435 - 3.34930536209472551334 * eta3
1436 - 0.97140932625194231775 * eta2 * chi2
1437 - 1.69734302394369973577 * eta2 * chi
1438 + 0.28539204856044564362 * eta2
1439 + 0.2419483723662931296 * eta * chi3
1440 + 0.51801427018052081941 * eta * chi2
1441 + 0.25096450064948544467 * eta * chi
1442 - 0.31709602351033533418 * eta
1443 - 0.01525897668158244028 * chi4
1444 - 0.06692658483513916345 * chi3
1445 - 0.08715176045684569495 * chi2
1446 - 0.09133931944098934441 * chi
1447 - 0.2685414392185025978);
1450 XLALPrintError(
"XLAL Error - %s: At present only fits for the (2,2) mode are available.\n", __func__);
1464 UNUSED
static inline REAL8
1473 -0.10069512275335238 * (-0.46107388514323044 +
1474 eta) * (0.2832795481380979 + eta) +
1475 0.2614619716504706 * chi * (-0.24838163750494138 +
1476 eta) * (0.320112993649413 + eta) +
1477 chi * chi * (0.010000160002560042 - 0.16000256004096067 * eta * eta);
1481 res = -0.07086074186161867 * chi * (-0.26367236731979804 +
1482 eta) * (-0.0010019969893089581 +
1484 0.2893863668183948 * (-0.16845695144529893 +
1485 eta) * (0.23032241797163952 + eta) +
1486 (0.004086861548547749 - 0.06538978477676398 * eta * eta +
1487 chi * (0.0006334026884930817 -
1488 0.010134443015889307 * eta * eta)) * log (68.47466578101876 -
1500 UNUSED
static inline REAL8
1504 REAL8 chi =
a, eta2 = eta*eta;
1506 REAL8 fTPL, fEQ, A1, e0, e1;
1512 fTPL = -0.011209791668428353 + (0.0040867958978563915 + 0.0006333925136134493 * chi) * log(68.47466578100956 - 58.301487557007206 * chi);
1514 fEQ = 0.01128156666995859 + 0.0002869276768158971* chi;
1516 e0 = 0.01574321112717377;
1517 e1 = 0.02244178140869133;
1522 res = (0.0070987396362959514 + eta*0.024816844694685373 -eta2*0.050428973182277494 + eta*eta2*0.03442040062259341-chi*0.0017751850002442097+eta*chi*0.004244058872768811
1523 -eta2*chi*0.031996494883796855-chi*chi*0.0035627260615894584+eta*chi*chi*0.01471807973618255 - chi*chi*chi*0.0019020967877681962);
1526 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1535 res = 0.010337157192240338 - 0.0053067782526697764*chi*chi - 0.005087932726777773*chi*chi*chi+
1536 eta*(0.027735564986787684 + 0.018864151181629343*chi + 0.021754491131531044*chi*chi + 0.01785477515931398*chi*chi*chi)+
1537 eta2*(0.018084233854540898 - 0.08204268775495138*chi);
1541 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1551 res = 0.013997911323773867 - 0.0051178205260273574*chi - 0.0073874256262988*chi*chi +
1552 eta*(0.0528489379269367 + 0.01632304766334543*chi + 0.02539072293029433*chi*chi)
1553 +eta2*(-0.06529992724396189 + 0.05782894076431308*chi);
1557 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1565 res = 0.01763430670755021 - 0.00024925743340389135*chi - 0.009240404217656968*chi*chi - 0.007907831334704586*chi*chi*chi+
1566 eta*(-0.1366002854361568 + 0.0561378177186783*chi + 0.16406275673019852*chi*chi + 0.07736232247880881*chi*chi*chi)+
1567 eta2*(0.9875890632901151 - 0.31392112794887855*chi - 0.5926145463423832*chi*chi) - 1.6943356548192614*eta2*eta;
1571 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1577 XLALPrintError(
"XLAL Error - %s: (%d,%d) mode. At present only fits for the (2,2), (2,1), (3,3), (4,4) and (5,5) mode are available.\n", __func__, modeL, modeM);
1589 UNUSED
static inline REAL8
1594 return 1.3547468629743946 * eta + 0.9187885481024214 * eta * eta;
1601 UNUSED
static inline REAL8
1606 return eta * (-0.0024971911410897156 +
1607 (-0.006128515435641139 +
1608 0.01732656 *
a / (2.0 - 4.0 * eta)) * eta);
1615 UNUSED
static inline REAL8
1619 return 0.27581190323955274 + 0.19347381066059993 * eta
1620 - 0.08898338208573725 * log (1.0 -
a / (1.0 - 2.0 * eta))
1622 eta * eta * (1.78832 * (0.2690779744133912 +
a / (2.0 - 4.0 * eta)) *
1623 (1.2056469070395925 +
a / (2.0 - 4.0 * eta)) +
1624 1.423734113371796 * log (1.0 -
a / (1.0 - 2.0 * eta)));
1631 UNUSED
static inline REAL8
1636 return 0.006075014646800278 + 0.012040017219351778 * eta
1637 + (0.0007353536801336875 +
1638 0.0015592659912461832 *
a / (1.0 - 2.0 * eta)) * log (1.0 -
a / (1.0 -
1641 + eta * eta * (0.03575969677378844 +
1642 (-0.011765658882139 -
1643 0.02494825585993893 *
a / (1.0 - 2.0 * eta)) * log (1.0 -
1654 UNUSED
static inline REAL8
1670 REAL8 eta = m1 * m2 / ((m1 + m2) * (m1 + m2));
1672 (chi1 + chi2) / 2. + (chi1 - chi2) / 2. * ((m1 - m2) / (m1 + m2)) / (1 -
1679 return (0.75 * eta * chi + sqrt (1. - 4. * eta)) * (57.1755 -
1684 return (0.75 * eta * chi + sqrt (1. - 4. * eta)) * (2.5 + 10. * chichi +
1690 return 2.5 + (1. + 2.5 * chi) * (-2.5 + 2.5 * sqrt (1. - 4. * eta));
1698 UNUSED
static inline REAL8
1707 REAL8 eta = m1 * m2 / (m1 + m2) / (m1 + m2);
1709 0.5 * (chi1 + chi2) + 0.5 * (chi1 - chi2) * (m1 - m2) / (m1 + m2) / (1. -
1712 REAL8 eta2 = eta * eta, eta3 = eta2 * eta;
1713 REAL8 chiTo2 = chi * chi, chiTo3 = chiTo2 * chi;
1714 REAL8 coeff00, coeff01, coeff02, coeff03;
1715 REAL8 coeff10, coeff11, coeff12, coeff13;
1716 REAL8 coeff20, coeff21, coeff22, coeff23;
1717 REAL8 coeff30, coeff31, coeff32, coeff33;
1736 res = coeff00 + coeff01 * chi + coeff02 * chiTo2 + coeff03 * chiTo3 +
1737 coeff10 * eta + coeff11 * eta * chi + coeff12 * eta * chiTo2 +
1738 coeff13 * eta * chiTo3 + coeff20 * eta2 + coeff21 * eta2 * chi +
1739 coeff22 * eta2 * chiTo2 + coeff23 * eta2 * chiTo3 + coeff30 * eta3 +
1740 coeff31 * eta3 * chi + coeff32 * eta3 * chiTo2 + coeff33 * eta3 * chiTo3;
1744 if((
l == 5)&&(
m == 5)){
1755 UNUSED
static inline REAL8
1758 REAL8 chi =
a / (1.0 - 2.0 * eta);
1759 REAL8 eta2 = eta * eta;
1760 if (eta > 50. / 51. / 51.)
1762 return 0.43747541927878864 + (-0.10933208665273314 -
1763 0.007325831113333813 * chi) *
1764 log (4.500844771420863 - 9.681916048928946 * eta +
1765 chi * (-4.254886879579986 + 11.513558950322647 * eta));
1769 return 1.5609526077704716 - 122.25721149839733 * eta +
1770 3586.2192688666914 * eta2 - 13869.506144441548 * eta * eta2 +
1771 (eta - 0.25) * (1651.5823693445805 * (-0.01922337588094282 + eta) *
1772 (-0.01922337536857659 + eta) +
1773 66.87492814925524 * chi * (0.0003695381704106058 -
1774 0.03844675124951941 * eta +
1776 log (5600.67382718678 - 5555.824895398546 * chi) +
1777 (-1412.8186461833657 + 67.66455403259023 * chi) * (eta -
1779 (0.0003695381704106056 - 0.038446751249519406 * eta +
1780 eta2) * log (0.5680439481719505 - 0.36813967358200156 * chi) +
1781 0.012328326527732041 * log (4.500844771420863 -
1782 9.681916048928946 * eta +
1783 chi * (-4.254886879579986 +
1784 11.513558950322647 * eta)) +
1785 0.0008260634258180991 * chi * log (4.500844771420863 -
1786 9.681916048928946 * eta +
1787 chi * (-4.254886879579986 +
1788 11.513558950322647 * eta)) -
1789 12.6575493872956 * eta * log (4.500844771420863 -
1790 9.681916048928946 * eta +
1791 chi * (-4.254886879579986 +
1792 11.513558950322647 * eta)) -
1793 0.8481231078533651 * chi * eta * log (4.500844771420863 -
1794 9.681916048928946 * eta +
1795 chi * (-4.254886879579986 +
1796 11.513558950322647 *
1798 329.2228595635586 * eta2 * log (4.500844771420863 -
1799 9.681916048928946 * eta +
1800 chi * (-4.254886879579986 +
1801 11.513558950322647 * eta)) +
1802 22.05968203526603 * chi * eta2 * log (4.500844771420863 -
1803 9.681916048928946 * eta +
1804 chi * (-4.254886879579986 +
1805 11.513558950322647 *
1814 UNUSED
static inline REAL8
1818 REAL8 chi =
a / (1.0 - 2.0 * eta);
1819 REAL8 eta2 = eta * eta;
1823 return -0.07086074186161867 * chi * (-0.26367236731979804 + eta) *
1824 (-0.0010019969893089581 + eta) + 0.2893863668183948 *
1825 (-0.16845695144529893 + eta) * (0.23032241797163952 + eta) +
1826 (0.004086861548547749 - 0.06538978477676398 * eta2 +
1827 chi * (0.0006334026884930817 - 0.010134443015889307 * eta2)) *
1828 log (68.47466578101876 - 58.30148755701496 * chi);
1832 return -0.10069512275335238 * (-0.46107388514323044 + eta) *
1833 (0.2832795481380979 + eta) + 0.2614619716504706 * chi *
1834 (-0.24838163750494138 + eta) * (0.320112993649413 + eta) +
1835 chi * chi * (0.010000160002560042 - 0.16000256004096067 * eta2);
1870 UINT4 SpinAlignedEOBversion
1893 REAL8 eta = (m1 * m2) / ((m1 + m2) * (m1 + m2));
1894 REAL8 amp, aDot, aDDot;
1895 REAL8 omega, omegaDot;
1897 REAL8 qNSLMPeak, qNSLMDot, qNSLMDDot;
1898 REAL8 pNSLMDot, pNSLMDDot;
1901 REAL8 nromega, nromegaDot;
1903 REAL8 nrDeltaT, nrTimePeak;
1904 REAL8 chi1 = chiS + chiA;
1905 REAL8 chi2 = chiS - chiA;
1908 gsl_spline *spline = NULL;
1909 gsl_interp_accel *acc = NULL;
1912 gsl_matrix *qMatrix = NULL, *pMatrix = NULL;
1913 gsl_vector *aCoeff = NULL, *bCoeff = NULL;
1915 gsl_vector *amps = NULL, *omegaVec = NULL;
1917 gsl_permutation *perm1 = NULL, *perm2 = NULL;
1936 if (!timeVec || !
q3 || !
q4 || !
q5 || !p3 || !p4 || !qNS || !pNS || !q3LM
1937 || !q4LM || !q5LM || !qNSLM)
1955 switch (SpinAlignedEOBversion)
1998 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1 and v2 are available.\n",
2005 for (
unsigned int i = 0;
i < timeVec->length;
i++)
2008 REAL8 rootR = sqrt (rVec->data[
i]);
2009 REAL8 rOmega = rVec->data[
i] * orbOmegaVec->data[
i];
2015 q1 = prVec->data[
i] * prVec->data[
i] / (rOmega * rOmega);
2016 q2 =
q1 / rVec->data[
i];
2017 q3->data[
i] =
q2 / rootR;
2018 q4->data[
i] =
q2 / rVec->data[
i];
2019 q5->data[
i] =
q3->data[
i] / rVec->data[
i];
2021 p1 = prVec->data[
i] / rOmega;
2022 p2 = p1 * prVec->data[
i] * prVec->data[
i];
2023 p3->
data[
i] = p2 / rootR;
2024 p4->data[
i] = p2 / rVec->data[
i];
2027 coeffs->a1 *
q1 + coeffs->a2 *
q2 + coeffs->a3 *
q3->data[
i];
2028 pNS->data[
i] = coeffs->b1 * p1 + coeffs->b2 * p2;
2029 q3LM->
data[
i] =
q3->data[
i] * amplitude->data[
i];
2030 q4LM->
data[
i] =
q4->data[
i] * amplitude->data[
i];
2031 q5LM->
data[
i] =
q5->data[
i] * amplitude->data[
i];
2033 qNSLM->
data[
i] = qNS->
data[
i] * amplitude->data[
i];
2038 qMatrix = gsl_matrix_alloc (3, 3);
2039 aCoeff = gsl_vector_alloc (3);
2040 amps = gsl_vector_alloc (3);
2041 perm1 = gsl_permutation_alloc (3);
2043 pMatrix = gsl_matrix_alloc (2, 2);
2044 bCoeff = gsl_vector_alloc (2);
2045 omegaVec = gsl_vector_alloc (2);
2046 perm2 = gsl_permutation_alloc (2););
2048 if (!qMatrix || !aCoeff || !amps || !pMatrix || !bCoeff || !omegaVec)
2067 switch (SpinAlignedEOBversion)
2078 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1 and v2 are available.\n",
2106 nrTimePeak = timePeak - nrDeltaT;
2110 spline = gsl_spline_alloc (gsl_interp_cspline, amplitude->length);
2111 acc = gsl_interp_accel_alloc ();
2115 gsl_spline_init (spline, timeVec->data, q3LM->
data, q3LM->
length);
2116 gsl_matrix_set (qMatrix, 0, 0, gsl_spline_eval (spline, nrTimePeak, acc));
2117 gsl_matrix_set (qMatrix, 1, 0,
2118 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2119 gsl_matrix_set (qMatrix, 2, 0,
2120 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2123 gsl_spline_init (spline, timeVec->data, q4LM->
data, q4LM->
length);
2124 gsl_interp_accel_reset (acc);
2125 gsl_matrix_set (qMatrix, 0, 1, gsl_spline_eval (spline, nrTimePeak, acc));
2126 gsl_matrix_set (qMatrix, 1, 1,
2127 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2128 gsl_matrix_set (qMatrix, 2, 1,
2129 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2132 gsl_spline_init (spline, timeVec->data, q5LM->
data, q5LM->
length);
2133 gsl_interp_accel_reset (acc);
2134 gsl_matrix_set (qMatrix, 0, 2, gsl_spline_eval (spline, nrTimePeak, acc));
2135 gsl_matrix_set (qMatrix, 1, 2,
2136 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2137 gsl_matrix_set (qMatrix, 2, 2,
2138 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2142 gsl_spline_init (spline, timeVec->data, amplitude->data, amplitude->length);
2143 gsl_interp_accel_reset (acc);
2144 amp = gsl_spline_eval (spline, nrTimePeak, acc);
2145 aDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2146 aDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2149 gsl_spline_init (spline, timeVec->data, qNSLM->
data, qNSLM->
length);
2150 gsl_interp_accel_reset (acc);
2151 qNSLMPeak = gsl_spline_eval (spline, nrTimePeak, acc);
2152 qNSLMDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2153 qNSLMDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2175 gsl_vector_set (amps, 0, nra - amp - qNSLMPeak);
2176 gsl_vector_set (amps, 1, -aDot - qNSLMDot);
2177 gsl_vector_set (amps, 2, nraDDot - aDDot - qNSLMDDot);
2181 gsl_linalg_LU_decomp (qMatrix, perm1, &signum);
2182 gsl_linalg_LU_solve (qMatrix, perm1, amps, aCoeff);
2188 gsl_spline_init (spline, timeVec->data, p3->
data, p3->
length);
2189 gsl_interp_accel_reset (acc);
2190 gsl_matrix_set (pMatrix, 0, 0,
2191 -gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2192 gsl_matrix_set (pMatrix, 1, 0,
2193 -gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2196 gsl_spline_init (spline, timeVec->data, p4->data, p4->length);
2197 gsl_interp_accel_reset (acc);
2198 gsl_matrix_set (pMatrix, 0, 1,
2199 -gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2200 gsl_matrix_set (pMatrix, 1, 1,
2201 -gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2205 gsl_spline_init (spline, timeVec->data, phase->data, phase->length);
2206 gsl_interp_accel_reset (acc);
2207 omega = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2208 omegaDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2211 gsl_spline_init (spline, timeVec->data, pNS->data, pNS->length);
2212 gsl_interp_accel_reset (acc);
2213 pNSLMDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2214 pNSLMDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2217 if (omega * omegaDot > 0.0)
2219 omega = fabs (omega);
2220 omegaDot = fabs (omegaDot);
2224 omega = fabs (omega);
2225 omegaDot = -fabs (omegaDot);
2230 switch (SpinAlignedEOBversion)
2242 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1 and v2 are available.\n",
2268 gsl_vector_set (omegaVec, 0, nromega - omega + pNSLMDot);
2269 gsl_vector_set (omegaVec, 1, nromegaDot - omegaDot + pNSLMDDot);
2282 gsl_linalg_LU_decomp (pMatrix, perm2, &signum);
2283 gsl_linalg_LU_solve (pMatrix, perm2, omegaVec, bCoeff);
2289 switch (SpinAlignedEOBversion)
2292 coeffs->b3 = gsl_vector_get (bCoeff, 0);
2293 coeffs->b4 = gsl_vector_get (bCoeff, 1);
2301 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1 and v2 are available.\n",
2322 gsl_matrix_free (qMatrix);
2323 gsl_vector_free (amps);
2324 gsl_vector_free (aCoeff);
2325 gsl_permutation_free (perm1);
2327 gsl_matrix_free (pMatrix);
2328 gsl_vector_free (omegaVec);
2329 gsl_vector_free (bCoeff);
2330 gsl_permutation_free (perm2);
2332 gsl_spline_free (spline);
2333 gsl_interp_accel_free (acc);
2394 REAL8 eta = (m1 * m2) / ((m1 + m2) * (m1 + m2));
2395 REAL8 amp, aDot, aDDot;
2396 REAL8 omega, omegaDot;
2398 UNUSED
REAL8 qNSLMPeak, qNSLMDot, qNSLMDDot;
2399 UNUSED
REAL8 pNSLMDot, pNSLMDDot;
2401 REAL8 nra, nraDot, nraDDot;
2402 REAL8 nromega, nromegaDot;
2404 REAL8 nrDeltaT, nrTimePeak;
2405 REAL8 chi1 = chiS + chiA;
2406 REAL8 chi2 = chiS - chiA;
2409 gsl_spline *spline = NULL;
2410 gsl_interp_accel *acc = NULL;
2413 gsl_matrix *qMatrix = NULL, *pMatrix = NULL;
2414 gsl_vector *aCoeff = NULL, *bCoeff = NULL;
2416 gsl_vector *amps = NULL, *omegaVec = NULL;
2418 gsl_permutation *perm1 = NULL, *perm2 = NULL;
2437 if (!timeVec || !
q3 || !
q4 || !
q5 || !p3 || !p4 || !qNS || !pNS || !q3LM
2438 || !q4LM || !q5LM || !qNSLM)
2457 for (
unsigned int i = 0;
i < timeVec->length;
i++)
2460 REAL8 rootR = sqrt (rVec->data[
i]);
2461 REAL8 rOmega = rVec->data[
i] * orbOmegaVec->data[
i];
2467 q1 = prVec->data[
i] * prVec->data[
i] / (rOmega * rOmega);
2468 q2 =
q1 / rVec->data[
i];
2471 q5->data[
i] =
q2 / rootR;
2473 p1 = prVec->data[
i] / rOmega;
2474 p2 = p1 * prVec->data[
i] * prVec->data[
i];
2480 q3LM->
data[
i] =
q3->data[
i] * amplitude->data[
i];
2481 q4LM->
data[
i] =
q4->data[
i] * amplitude->data[
i];
2482 q5LM->
data[
i] =
q5->data[
i] * amplitude->data[
i];
2485 qNSLM->
data[
i] = 0.;
2493 qMatrix = gsl_matrix_alloc (3, 3);
2494 aCoeff = gsl_vector_alloc (3);
2495 amps = gsl_vector_alloc (3);
2496 perm1 = gsl_permutation_alloc (3);
2498 pMatrix = gsl_matrix_alloc (2, 2);
2499 bCoeff = gsl_vector_alloc (2);
2500 omegaVec = gsl_vector_alloc (2);
2501 perm2 = gsl_permutation_alloc (2););
2503 if (!qMatrix || !aCoeff || !amps || !pMatrix || !bCoeff || !omegaVec)
2547 nrTimePeak = timePeak - nrDeltaT;
2549 printf (
"nrTimePeak, timePeak %.16e %.16e\n", nrTimePeak, timePeak);
2552 spline = gsl_spline_alloc (gsl_interp_cspline, amplitude->length);
2553 acc = gsl_interp_accel_alloc ();
2557 gsl_spline_init (spline, timeVec->data, q3LM->
data, q3LM->
length);
2558 gsl_matrix_set (qMatrix, 0, 0, gsl_spline_eval (spline, nrTimePeak, acc));
2559 gsl_matrix_set (qMatrix, 1, 0,
2560 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2561 gsl_matrix_set (qMatrix, 2, 0,
2562 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2565 gsl_spline_init (spline, timeVec->data, q4LM->
data, q4LM->
length);
2566 gsl_interp_accel_reset (acc);
2567 gsl_matrix_set (qMatrix, 0, 1, gsl_spline_eval (spline, nrTimePeak, acc));
2568 gsl_matrix_set (qMatrix, 1, 1,
2569 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2570 gsl_matrix_set (qMatrix, 2, 1,
2571 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2574 gsl_spline_init (spline, timeVec->data, q5LM->
data, q5LM->
length);
2575 gsl_interp_accel_reset (acc);
2576 gsl_matrix_set (qMatrix, 0, 2, gsl_spline_eval (spline, nrTimePeak, acc));
2577 gsl_matrix_set (qMatrix, 1, 2,
2578 gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2579 gsl_matrix_set (qMatrix, 2, 2,
2580 gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2584 gsl_spline_init (spline, timeVec->data, amplitude->data, amplitude->length);
2585 gsl_interp_accel_reset (acc);
2586 amp = gsl_spline_eval (spline, nrTimePeak, acc);
2587 aDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2588 aDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2591 gsl_spline_init (spline, timeVec->data, qNSLM->
data, qNSLM->
length);
2592 gsl_interp_accel_reset (acc);
2593 qNSLMPeak = gsl_spline_eval (spline, nrTimePeak, acc);
2594 qNSLMDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2595 qNSLMDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2629 gsl_vector_set (amps, 0, nra - amp);
2630 gsl_vector_set (amps, 1,nraDot -aDot);
2632 gsl_vector_set (amps, 2, nraDDot - aDDot);
2640 gsl_linalg_LU_decomp (qMatrix, perm1, &signum);
2641 gsl_linalg_LU_solve (qMatrix, perm1, amps, aCoeff);
2645 printf (
"Q MATRIX\n");
2646 for (
unsigned int i = 0;
i < 3;
i++)
2648 for (
unsigned int j = 0; j < 3; j++)
2650 printf (
"%.12e\t", gsl_matrix_get (qMatrix,
i, j));
2652 printf (
"= %.12e\n", gsl_vector_get (amps,
i));
2662 gsl_spline_init (spline, timeVec->data, p3->
data, p3->
length);
2663 gsl_interp_accel_reset (acc);
2664 gsl_matrix_set (pMatrix, 0, 0,
2665 -gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2666 gsl_matrix_set (pMatrix, 1, 0,
2667 -gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2670 gsl_spline_init (spline, timeVec->data, p4->data, p4->length);
2671 gsl_interp_accel_reset (acc);
2672 gsl_matrix_set (pMatrix, 0, 1,
2673 -gsl_spline_eval_deriv (spline, nrTimePeak, acc));
2674 gsl_matrix_set (pMatrix, 1, 1,
2675 -gsl_spline_eval_deriv2 (spline, nrTimePeak, acc));
2679 gsl_spline_init (spline, timeVec->data, phase->data, phase->length);
2680 gsl_interp_accel_reset (acc);
2681 omega = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2682 omegaDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2685 gsl_spline_init (spline, timeVec->data, pNS->data, pNS->length);
2686 gsl_interp_accel_reset (acc);
2687 pNSLMDot = gsl_spline_eval_deriv (spline, nrTimePeak, acc);
2688 pNSLMDDot = gsl_spline_eval_deriv2 (spline, nrTimePeak, acc);
2691 if (omega * omegaDot > 0.0)
2693 omega = fabs (omega);
2694 omegaDot = fabs (omegaDot);
2698 omega = fabs (omega);
2699 omegaDot = -fabs (omegaDot);
2704 chiS + chiA * (m1 - m2) / (m1 + m2) / (1. -
2708 chiS + chiA * (m1 - m2) / (m1 + m2) / (1. -
2713 printf (
"NR inputs: %.16e, %.16e, %.16e, %.16e\n", nra, nraDDot, nromega,
2735 gsl_vector_set (omegaVec, 0, nromega - omega);
2736 gsl_vector_set (omegaVec, 1, nromegaDot - omegaDot);
2740 printf (
"P MATRIX\n");
2741 for (
unsigned int i = 0;
i < 2;
i++)
2743 for (
unsigned int j = 0; j < 2; j++)
2745 printf (
"%.12e\t", gsl_matrix_get (pMatrix,
i, j));
2747 printf (
"= %.12e\n", gsl_vector_get (omegaVec,
i));
2752 gsl_linalg_LU_decomp (pMatrix, perm2, &signum);
2753 gsl_linalg_LU_solve (pMatrix, perm2, omegaVec, bCoeff);
2763 coeffs->a1 = gsl_vector_get (aCoeff, 0);
2764 coeffs->a2 = gsl_vector_get (aCoeff, 1);
2765 coeffs->a3 = gsl_vector_get (aCoeff, 2);
2767 coeffs->b1 = gsl_vector_get (bCoeff, 0);
2768 coeffs->b2 = gsl_vector_get (bCoeff, 1);
2779 gsl_matrix_free (qMatrix);
2780 gsl_vector_free (amps);
2781 gsl_vector_free (aCoeff);
2782 gsl_permutation_free (perm1);
2784 gsl_matrix_free (pMatrix);
2785 gsl_vector_free (omegaVec);
2786 gsl_vector_free (bCoeff);
2787 gsl_permutation_free (perm2);
2789 gsl_spline_free (spline);
2790 gsl_interp_accel_free (acc);
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaDot(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak frequency slope predicted by fitting NR results (currently only 2,2 available).
static UNUSED int XLALSimIMRSpinEOBNonQCCorrection(COMPLEX16 *restrict nqc, REAL8Vector *restrict values, const REAL8 omega, EOBNonQCCoeffs *restrict coeffs)
This function calculates the non-quasicircular correction to apply to the waveform.
static REAL8 CombineTPLEQMFits(REAL8 eta, REAL8 A1, REAL8 fEQ, REAL8 fTPL)
Combine two spin-dependent fits of NR input values in a quardatic-in-eta polynomial with the linear-i...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaV2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 a)
Peak frequency predicted by fitting NR results (currently only 2,2 available).
static UNUSED int XLALSimIMREOBCalculateNQCCoefficients(EOBNonQCCoeffs *restrict coeffs, REAL8Vector *restrict amplitude, REAL8Vector *restrict phase, REAL8Vector *restrict q1, REAL8Vector *restrict q2, REAL8Vector *restrict q3, REAL8Vector *restrict p1, REAL8Vector *restrict p2, INT4 l, INT4 m, REAL8 timePeak, REAL8 deltaT, REAL8 eta)
This function computes the coefficients a1, a2, etc.
static UNUSED int XLALSimIMREOBNonQCCorrection(COMPLEX16 *restrict nqc, REAL8Vector *restrict values, const REAL8 omega, EOBNonQCCoeffs *restrict coeffs)
This function calculates the non-quasicircular correction to apply to the waveform.
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakADotV4(INT4 modeL, INT4 modeM, REAL8 UNUSED m1, REAL8 UNUSED m2, REAL8 UNUSED chiS, REAL8 UNUSED chiA)
Peak amplitude slope predicted by fitting NR results.
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakAmplitude(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak amplitude predicted by fitting NR results (currently only 2,2 available).
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakDeltaTv2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED m1, REAL8 UNUSED m2, REAL8 chi1, REAL8 chi2)
The time difference between the orbital peak and the peak amplitude of the mode in question (currentl...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaDotV2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak frequency slope predicted by fitting NR results (currently only 2,2 available).
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakDeltaT(INT4 l, INT4 m, REAL8 UNUSED eta, REAL8 a)
The time difference between the orbital peak and the peak amplitude of the mode in question (currentl...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaDotV4(INT4 modeL, INT4 modeM, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak frequency slope predicted by fitting NR results The coefficients for the (2,2) are in Eq.
static REAL8 GetNRPeakADDot(INT4 l, INT4 m, REAL8 eta)
Function which returns second derivative of the amplitude at the peak taken from a fit to numerical r...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmega(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 a)
Peak frequency predicted by fitting NR results (currently only 2,2 available).
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakAmplitudeV4(INT4 modeL, INT4 modeM, REAL8 m1, REAL8 m2, REAL8 chiS, REAL8 chiA)
Peak amplitude predicted by fitting NR results The coefficients for the mode (2,2) are in Eq.
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakADDot(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak amplitude curvature predicted by fitting NR results (currently only 2,2 available).
static REAL8 GetNRPeakAmplitude(INT4 l, INT4 m, REAL8 eta)
Function which returns a value of the expected peak amplitude taken from a fit to numerical relativit...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegav2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 a)
Peak frequency predicted by fitting NR results (currently only 2,2 available).
static UNUSED int XLALSimIMRSpinEOBCalculateNQCCoefficients(REAL8Vector *restrict amplitude, REAL8Vector *restrict phase, REAL8Vector *restrict rVec, REAL8Vector *restrict prVec, REAL8Vector *restrict orbOmegaVec, INT4 l, INT4 m, REAL8 timePeak, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 a, REAL8 chiA, REAL8 chiS, EOBNonQCCoeffs *restrict coeffs, UINT4 SpinAlignedEOBversion)
This function computes the coefficients a3s, a4, etc.
static UNUSED int XLALSimIMREOBGetCalibratedNQCCoeffs(EOBNonQCCoeffs *coeffs, INT4 l, INT4 m, REAL8 eta)
For the 2,2 mode, there are fits available for the NQC coefficients, given in Eqs.
static REAL8 XLALSimIMREOBGetNRPeakDeltaT(INT4 l, INT4 m, REAL8 eta)
Compute the time offset which should be used in computing the non-quasicircular correction and perfor...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaV5(INT4 modeL, INT4 modeM, REAL8 UNUSED eta, REAL8 a)
Peak frequency predicted by fitting NR results used in SEOBNRv5 The coefficients are in Eq.
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaV4(INT4 modeL, INT4 modeM, REAL8 UNUSED eta, REAL8 a)
Peak frequency predicted by fitting NR results The coefficients for the (2,2) are in Eq.
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakADDotV4(INT4 modeL, INT4 modeM, REAL8 m1, REAL8 m2, REAL8 chiS, REAL8 chiA)
Peak amplitude curvature predicted by fitting NR results.
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakDeltaTv4(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED m1, REAL8 UNUSED m2, REAL8 UNUSED chi1, REAL8 UNUSED chi2)
The time difference between the orbital peak and the peak amplitude of the mode in question (currentl...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakADDotV2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak amplitude curvature predicted by fitting NR results (currently only 2,2 available).
static REAL8 GetNRPeakOmega(INT4 l, INT4 m, REAL8 eta)
Function which returns a value of the expected peak frequency taken from a fit to numerical relativit...
static REAL8 GetNRPeakOmegaDot(INT4 l, INT4 m, REAL8 eta)
Function which returns the derivative of the expected peak frequency taken from a fit to numerical re...
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakOmegaDotv2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak frequency slope predicted by fitting NR results (currently only 2,2 available).
static UNUSED REAL8 XLALSimIMREOBGetNRSpinPeakAmplitudeV2(INT4 UNUSED l, INT4 UNUSED m, REAL8 UNUSED eta, REAL8 UNUSED a)
Peak amplitude predicted by fitting NR results (currently only 2,2 available).
static UNUSED int XLALSimIMRSpinEOBCalculateNQCCoefficientsV4(REAL8Vector *restrict amplitude, REAL8Vector *restrict phase, REAL8Vector *restrict rVec, REAL8Vector *restrict prVec, REAL8Vector *restrict orbOmegaVec, INT4 modeL, INT4 modeM, REAL8 timePeak, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 chiA, REAL8 chiS, EOBNonQCCoeffs *restrict coeffs)
This function computes the coefficients a3s, a4, etc.
static UNUSED int XLALSimIMRGetEOBCalibratedSpinNQC(EOBNonQCCoeffs *restrict coeffs, INT4 UNUSED l, INT4 UNUSED m, REAL8 eta, REAL8 a)
More recent versions of the EOB models, such as EOBNRv2 and SEOBNRv1, utilise a non-quasicircular cor...
static UNUSED int XLALSimIMRGetEOBCalibratedSpinNQC3D(EOBNonQCCoeffs *restrict coeffs, INT4 UNUSED l, INT4 UNUSED m, REAL8 m1, REAL8 m2, REAL8 a, REAL8 chiAin)
Function to 3D-interpolate known amplitude NQC coeffcients of spin terms for SEOBNRv2,...
static REAL8 UNUSED q5(REAL8 UNUSED f0, REAL8 inc, REAL8 bet, REAL8 FPlus, REAL8 FCross)
static REAL8 UNUSED q3(REAL8 e0, REAL8 f0, REAL8 inc, REAL8 bet, REAL8 FPlus, REAL8 FCross)
static REAL8 UNUSED q2(REAL8 e0, REAL8 f0, REAL8 inc, REAL8 bet, REAL8 FPlus, REAL8 FCross)
static REAL8 UNUSED q1(REAL8 e0, REAL8 f0, REAL8 inc, REAL8 bet, REAL8 FPlus, REAL8 FCross)
static REAL8 UNUSED q4(REAL8 e0, REAL8 f0, REAL8 inc, REAL8 bet, REAL8 FPlus, REAL8 FCross)
#define XLAL_CALLGSL(statement)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_ERROR_REAL8(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_IS_REAL8_FAIL_NAN(val)
The coefficients which are used in calculating the non-quasicircular correction to the EOBNRv2 model.