25 #include <lal/LALSimInspiral.h>
26 #include <lal/LALSimIMR.h>
28 #include <lal/TimeSeries.h>
29 #include <lal/Units.h>
30 #include <lal/LALAdaptiveRungeKuttaIntegrator.h>
31 #include <lal/SphericalHarmonics.h>
32 #include <lal/LALSimSphHarmMode.h>
34 #include <lal/VectorOps.h>
36 #include <gsl/gsl_sf_gamma.h>
37 #include <gsl/gsl_matrix.h>
67 #define SEOBNRv4HM_PA 4111
68 #define pSEOBNRv4HM_PA 4112
74 #define UNUSED __attribute__ ((unused))
81 UNUSED gsl_interp_accel *acc1 = gsl_interp_accel_alloc();
82 gsl_spline *spline1 = gsl_spline_alloc(gsl_interp_cspline, tVec->
length);
85 UNUSED gsl_interp_accel *acc2 = gsl_interp_accel_alloc();
86 gsl_spline *spline2 = gsl_spline_alloc(gsl_interp_cspline, tVec->
length);
89 UNUSED gsl_interp_accel *acc3 = gsl_interp_accel_alloc();
90 gsl_spline *spline3 = gsl_spline_alloc(gsl_interp_cspline, tVec->
length);
93 UNUSED gsl_interp_accel *acc4 = gsl_interp_accel_alloc();
94 gsl_spline *spline4 = gsl_spline_alloc(gsl_interp_cspline, tVec->
length);
96 values->
data[0] = gsl_spline_eval(spline1, closestTime, acc1);
97 values->
data[1] = gsl_spline_eval(spline2, closestTime, acc2);
98 values->
data[2] = gsl_spline_eval(spline3, closestTime, acc3);
99 values->
data[3] = gsl_spline_eval(spline4, closestTime, acc4);
101 gsl_spline_free (spline1);
102 gsl_interp_accel_free (acc1);
104 gsl_spline_free (spline2);
105 gsl_interp_accel_free (acc2);
107 gsl_spline_free (spline3);
108 gsl_interp_accel_free (acc3);
110 gsl_spline_free (spline4);
111 gsl_interp_accel_free (acc4);
123 LALValue *ModeArray,
UINT4 SpinAlignedEOBversion)
164 LALValue *ModeArray,
UINT4 SpinAlignedEOBversion)
170 const UINT4 lmModes[5][2] = {{2, 2}, {3, 3}, {2, 1}, {4, 4}, {5, 5}};
192 for (
UINT4 EMM = 0; EMM <= ELL; EMM++) {
197 if ((modeL == ELL)&&(modeM == EMM)) {
204 XLALPrintError (
"Mode (%d,%d) is not available by the model %d.\n", ELL,
205 EMM, SpinAlignedEOBversion);
235 REAL8 X1v, X2v, lambda1v, lambda2v;
248 REAL8 kappa2T = 3*(X2v/X1v*lambda1v + X1v/X2v*lambda2v);
249 if ( kappa2T < 0. ) {
253 if ( kappa2T > 500. ) {
256 return 0.3596*(1. + 0.024384*kappa2T - 0.000017167*kappa2T*kappa2T)/(1. + 0.068865*kappa2T);
262 const double values[],
269 double omega_x, omega_y, omega_z, omega;
272 omega_x = values[1] * dvalues[2] - values[2] * dvalues[1];
273 omega_y = values[2] * dvalues[0] - values[0] * dvalues[2];
274 omega_z = values[0] * dvalues[1] - values[1] * dvalues[0];
276 r2 = values[0] * values[0] + values[1] * values[1] + values[2] * values[2];
278 sqrt (omega_x * omega_x + omega_y * omega_y + omega_z * omega_z) /
r2;
282 if (
r2 < 36. && omega < params->eobParams->omega)
287 params->eobParams->omega = omega;
301 const double values[],
316 if (
r < 6 && (omega < params->eobParams->omega || dvalues[2] >= 0))
318 params->eobParams->omegaPeaked = 0;
322 params->eobParams->omega = omega;
336 const double UNUSED values[],
338 void UNUSED * funcParams
341 if (dvalues[0] >= 0. || dvalues[2] >= 0. || isnan (dvalues[3]) || isnan (dvalues[2])
342 || isnan (dvalues[1]) || isnan (dvalues[0]))
363 const double UNUSED values[],
366 void UNUSED * funcParams
372 REAL8 rMerger = pow (
params->eobParams->omegaMerger/2., -2./3. );
376 counter =
params->eobParams->omegaPeaked;
378 if (
debugOutput) printf(
"function NSNS: r = %.16e, omega = %.16e, pr = %.16e, dpr = %.16e, count = %.16u\n",values[0],dvalues[1],values[2],dvalues[2],counter);
380 REAL8 rCheck = 1.5*rMerger;
381 if (
r < rCheck && omega < params->eobParams->omega)
383 if (
debugOutput) printf(
"Peak detection %.16e %.16e\n", omega,
params->eobParams->omega);
384 params->eobParams->omegaPeaked = counter + 1;
386 if ( omega >=
params->eobParams->omegaMerger/2. ) {
387 if (
debugOutput) printf(
"Stop at Tim's freq at r=%.16e\n",
r);
390 if (
r < rCheck && values[2] >= 0 ) {
391 if (
debugOutput) printf(
"Stop at pr >= 0 at r=%.16e\n",
r);
394 if (
r < rCheck && dvalues[0] >= 0 ) {
395 if (
debugOutput) printf(
"Stop at dr/dt >= 0 at r=%.16e\n",
r);
398 if (
r < rCheck && dvalues[2] >= 0 ) {
399 params->eobParams->omegaPeaked = counter + 1;
400 if (
debugOutput) printf(
"Stop at dpr/dt >= 0 at r=%.16e\n",
r);
403 if (r < rCheck && params->eobParams->omegaPeaked == 3 )
405 params->eobParams->omegaPeaked = 0;
406 if (
debugOutput) printf(
"params->eobParams->omegaPeaked == 3 at r=%.16e\n",
r);
409 if ( isnan (dvalues[3]) || isnan (dvalues[2]) || isnan (dvalues[1]) || isnan (dvalues[0]) ) {
410 if (
debugOutput) printf(
"Stop at nan's at r=%.16e\n",
r);
413 if ( fabs(
r/
params->eobParams->rad - 1.) < 1.e-3*64./5.*eta/(
r*
r*
r*
r)*0.02 && fabs(
r/
params->eobParams->rad - 1.) > 0.) {
414 if (
debugOutput) printf(
"Radius is stalling at r=%.16e and rad=%.16e\n",
r,
params->eobParams->rad);
417 params->eobParams->omega = omega;
420 params->eobParams->NyquistStop = 1;
421 if (
debugOutput) printf(
"Stop at Nyquist at r=%.16e\n",
r);
422 XLAL_PRINT_WARNING (
"Waveform will be generated only up to half the sampling frequency, thus discarding any physical higher-frequency contect above that!\n");
430 const double UNUSED values[],
433 void UNUSED * funcParams
441 counter =
params->eobParams->omegaPeaked;
443 if (
r < 6. && omega < params->eobParams->omega)
446 params->eobParams->omegaPeaked = counter + 1;
448 if (dvalues[2] >= 0. ||
params->eobParams->omegaPeaked == 5
449 || isnan (dvalues[3]) || isnan (dvalues[2]) || isnan (dvalues[1])
450 || isnan (dvalues[0]))
457 params->eobParams->omega = omega;
501 UINT4 SpinAlignedEOBversion
518 REAL8 Mtotal = m1 + m2;
519 REAL8 eta = m1 * m2 / (Mtotal * Mtotal);
528 REAL8 spin1[3] = { 0., 0., spin1z };
529 REAL8 spin2[3] = { 0., 0., spin2z };
533 for (ii = 0; ii < 3; ii++)
535 s1Vec.
data[ii] *= m1 * m1;
536 s2Vec.
data[ii] *= m2 * m2;
547 aa = sigmaKerr->
data[2];
550 switch (SpinAlignedEOBversion)
566 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1, v2 and v4 are available.\n",
606 UINT4 SpinAlignedEOBversion,
616 REAL8 lambda2Tidal1 = 0;
617 REAL8 omega02Tidal1 = 0;
618 REAL8 lambda3Tidal1 = 0;
619 REAL8 omega03Tidal1 = 0;
620 REAL8 lambda2Tidal2 = 0;
621 REAL8 omega02Tidal2 = 0;
622 REAL8 lambda3Tidal2 = 0;
623 REAL8 omega03Tidal2 = 0;
624 REAL8 quadparam1 = 0;
625 REAL8 quadparam2 = 0;
649 if (SpinAlignedEOBversion == 4112) TGRflag = 1;
668 if ( (SpinAlignedEOBversion == 201 || SpinAlignedEOBversion == 401) && lambda2Tidal1 != 0. ) {
670 if ( omega02Tidal1 == 0. ) {
671 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! Always provide non-zero f-mode frequency when lambda2 is non-zero!\n", __func__);
676 if ( lambda3Tidal1 != 0. && omega03Tidal1 == 0. ) {
677 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! Always provide non-zero octupolar f-mode frequency when lambda3 is non-zero!\n", __func__);
681 if ( (SpinAlignedEOBversion == 201 || SpinAlignedEOBversion == 401) && lambda2Tidal2 != 0. ) {
683 if ( omega02Tidal2 == 0. ) {
684 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! Always provide non-zero f-mode frequency when lambda2 is non-zero!\n", __func__);
689 if ( lambda3Tidal2 != 0. && omega03Tidal2 == 0. ) {
690 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! Always provide non-zero octupolar f-mode frequency when lambda3 is non-zero!\n", __func__);
700 if (ModeArray == NULL) {
719 if ( SpinAlignedEOBversion == 401 ) {
725 printf(
"First run SEOBNRv4 to compute NQCs\n");
742 nqcCoeffsInput, nqcFlag,
755 printf(
"Generate EOB wf\n");
769 SpinAlignedEOBversion,
770 lambda2Tidal1, lambda2Tidal2,
771 omega02Tidal1, omega02Tidal2,
772 lambda3Tidal1, lambda3Tidal2,
773 omega03Tidal1, omega03Tidal2,
774 quadparam1, quadparam2,
775 nqcCoeffsInput, nqcFlag,
787 if ( nqcCoeffsInput )
844 UINT4 SpinAlignedEOBversion,
848 const REAL8 lambda2Tidal1,
850 const REAL8 lambda2Tidal2,
852 const REAL8 omega02Tidal1,
854 const REAL8 omega02Tidal2,
856 const REAL8 lambda3Tidal1,
858 const REAL8 lambda3Tidal2,
860 const REAL8 omega03Tidal1,
862 const REAL8 omega03Tidal2,
864 const REAL8 quadparam1,
866 const REAL8 quadparam2,
880 if ( (lambda3Tidal1 != 0. && lambda2Tidal1 == 0.) || (lambda3Tidal2 != 0. && lambda2Tidal2 == 0.) ) {
881 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! You must have a non-zero lambda2 if you provide a non-zero lambda3!\n",
885 if ( SpinAlignedEOBversion==201 || SpinAlignedEOBversion==401 )
887 if ( (lambda2Tidal1 != 0. && omega02Tidal1 == 0.)
888 || (lambda2Tidal2 != 0. && omega02Tidal2 == 0.) ) {
889 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! Always provide non-zero compactness and f-mode frequency when lambda2 is non-zero!\n",
893 if ( (lambda3Tidal1 != 0. && omega03Tidal1 == 0.)
894 || (lambda3Tidal2 != 0. && omega03Tidal2 == 0.) ) {
895 XLALPrintError (
"XLAL Error - %s: Tidal parameters are not set correctly! Always provide non-zero compactness and f-mode frequency when lambda3 is non-zero!\n",
899 if (fmax(m1SI/m2SI, m2SI/m1SI)>3.) {
900 XLALPrintWarning(
"XLAL Warning - %s: Generating waveform with mass ratio outside the recommended range q=[1,3].\n", __func__);
902 if (fabs(spin1z)>0.5 || fabs(spin2z)>0.5) {
903 XLALPrintWarning(
"XLAL Warning - %s: Generating waveform with at least one aligned spin component outside the recommended range chi=[-0.5,0.5].\n", __func__);
905 if (lambda2Tidal1>5000. || lambda2Tidal2>5000.) {
906 XLALPrintWarning(
"XLAL Warning - %s: Generating waveform with at least one quadrupole tidal deformability outside the recommended range Lambda2=[0,5000].\n", __func__);
909 XLALPrintWarning(
"XLAL Warning - %s: Generating waveform with a low starting frequency. Initial conditions solver can fail when pushing the model to lower frequencies, with a rate of failure ~0.3%% at Mf~1.5e-4 (10Hz for M=3Msol).\n", __func__);
912 if ( SpinAlignedEOBversion==201 )
913 SpinAlignedEOBversion=2;
914 if ( SpinAlignedEOBversion==401 )
915 SpinAlignedEOBversion=4;
917 INT4 use_optimized_v2_or_v4 = 0;
919 if (SpinAlignedEOBversion == 200)
921 SpinAlignedEOBversion = 2;
922 use_optimized_v2_or_v4 = 1;
925 if (SpinAlignedEOBversion == 400)
927 SpinAlignedEOBversion = 4;
928 use_optimized_v2_or_v4 = 1;
934 const UINT4 lmModes[5][2] = {{2, 2}, {3, 3}, {2, 1}, {4, 4},{5, 5}};
938 UINT4 postAdiabaticFlag = 0;
941 if (SpinAlignedEOBversion == 4111 || SpinAlignedEOBversion == 4112) {
942 postAdiabaticFlag = 1;
951 if (SpinAlignedEOBversion == 4112) {
956 if (SpinAlignedEOBversion == 41 || SpinAlignedEOBversion == 4111 || SpinAlignedEOBversion == 4112) {
957 SpinAlignedEOBversion = 4;
963 if (SpinAlignedEOBversion != 1 && SpinAlignedEOBversion != 2
964 && SpinAlignedEOBversion != 4)
967 (
"XLAL Error - %s: SEOBNR version flag incorrectly set to %u\n",
968 __func__, SpinAlignedEOBversion);
973 switch (SpinAlignedEOBversion)
976 SpinAlignedEOBapproximant =
SEOBNRv1;
979 SpinAlignedEOBapproximant =
SEOBNRv2;
982 SpinAlignedEOBapproximant =
SEOBNRv4;
986 (
"XLAL Error - %s: SEOBNR version flag incorrectly set to %u\n",
987 __func__, SpinAlignedEOBversion);
995 if (spin1z < -1.0 || spin2z < -1.0)
997 XLALPrintError (
"XLAL Error - %s: Component spin less than -1!\n",
1001 if (spin1z > 1.0 || spin2z > 1.0)
1003 XLALPrintError (
"XLAL Error - %s: Component spin bigger than 1!\n",
1008 if (SpinAlignedEOBversion == 1 && (spin1z > 0.6 || spin2z > 0.6))
1011 (
"XLAL Error - %s: Component spin larger than 0.6!\nSEOBNRv1 is only available for spins in the range -1 < a/M < 0.6.\n",
1016 if ((SpinAlignedEOBversion == 2) && (spin1z > 0.99 || spin2z > 0.99))
1019 (
"XLAL Error - %s: Component spin larger than 0.99!\nSEOBNRv2 and SEOBNRv2_opt are only available for spins in the range -1 < a/M < 0.99.\n",
1027 if((m1SI/m2SI > 57.) && (spin1z> 0.96)){
1029 (
"XLAL Error - %s: Component spin of the more massive BH larger than 0.96 for mass ratio bigger than 57.!\nSEOBNRv4HM \
1030 for mass ratio bigger than 57 is only available when the spin on the more massive BH in the range -1 < a/M < 0.96.\n",__func__);
1035 if((m2SI/m1SI > 57.) && (spin2z> 0.96)){
1037 (
"XLAL Error - %s: Component spin of the more massive BH larger than 0.96 for mass ratio bigger than 57.!\nSEOBNRv4HM \
1038 for mass ratio bigger than 57 is only available when the spin on the more massive BH in the range -1 < a/M < 0.96.\n",__func__);
1057 REAL8 spin1[3] = { 0, 0, spin1z };
1058 REAL8 spin2[3] = { 0, 0, spin2z };
1059 REAL8 s1Data[3], s2Data[3], s1DataNorm[3], s2DataNorm[3];
1062 REAL8 m1, m2, mTotal, eta, mTScaled;
1070 phaseVec.
data = NULL;
1083 REAL8 cartPosData[3], cartMomData[3];
1102 REAL8 resampEstimate;
1116 UINT4 peakIdx = 0, finalIdx = 0;
1125 INT4 retLen_fromOptStep2 = 0;
1126 INT4 retLen_fromOptStep3 = 0;
1132 const REAL8 EPS_ABS = 1.0e-10;
1133 const REAL8 EPS_REL = 1.0e-9;
1156 eta = m1 * m2 / (mTotal * mTotal);
1159 if ((SpinAlignedEOBversion == 2 || SpinAlignedEOBversion == 4)
1160 && eta < 100. / 101. / 101.)
1163 (
"XLAL Error - %s: Mass ratio larger than 100!\nSEOBNRv2, SEOBNRv2_opt, SEOBNRv4, and SEOBNRv4_opt are only available for mass ratios up to 100.\n",
1171 printf(
"Amp = %.16e\n", amp0);
1177 if (pow (10., -3. / 2.)/(
LAL_PI * mTScaled) < fMin) {
1178 fStart = pow (10., -3. / 2.)/(
LAL_PI * mTScaled);
1194 tStepBack = 100. * mTScaled;
1195 if (SpinAlignedEOBversion == 4)
1197 tStepBack = 150. * mTScaled;
1206 resampEstimate = 50. *
deltaT / mTScaled;
1210 if (resampEstimate > 1.)
1212 resampPwr = (
UINT4) ceil (log2 (resampEstimate));
1222 UINT4 num_elements_in_values_vector = 4;
1223 if (use_optimized_v2_or_v4)
1227 num_elements_in_values_vector = 6;
1236 memset (&seobParams, 0,
sizeof (seobParams));
1237 memset (&seobCoeffs, 0,
sizeof (seobCoeffs));
1238 memset (&eobParams, 0,
sizeof (eobParams));
1239 memset (&hCoeffs, 0,
sizeof (hCoeffs));
1240 memset (&prefixes, 0,
sizeof (prefixes));
1244 modefreqVec.
data = &modeFreq;
1246 UINT4 mode_highest_freqL = 2;
1247 UINT4 mode_highest_freqM = 2;
1252 mode_highest_freqL = 5;
1253 mode_highest_freqM = 5;
1257 (&modefreqVec, m1, m2, spin1, spin2, mode_highest_freqL, mode_highest_freqM, 1,
1273 (
"XLAL Error - Starting frequency is above ringdown frequency!\n");
1279 if (use_tidal == 0 &&
deltaT >
LAL_PI / creal (modeFreq))
1282 (
"XLAL Error - %s: Ringdown frequency > Nyquist frequency!\nAt present this situation is not supported.\n",
1304 tidal1.
mByM = m1SI / (m1SI + m2SI);
1311 tidal2.
mByM = m2SI / (m1SI + m2SI);
1318 seobCoeffs.
tidal1 = &tidal1;
1319 seobCoeffs.
tidal2 = &tidal2;
1321 hCoeffs.
tidal1 = &tidal1;
1322 hCoeffs.
tidal2 = &tidal2;
1332 seobParams.
use_hm = use_hm;
1338 eobParams.
eta = eta;
1342 s1Vec.
data = s1Data;
1343 s2Vec.
data = s2Data;
1344 s1VecOverMtMt.
data = s1DataNorm;
1345 s2VecOverMtMt.
data = s2DataNorm;
1347 if ( use_tidal == 1 ) {
1349 REAL8 rMerger = pow ( omegaMerger/2., -2./3. );
1350 if ( pow( fStart*
LAL_PI*mTScaled, -2./3. ) <= 2.*rMerger ) {
1352 (
"XLAL Error - %s: fmin is too high for a tidal run, it should be at most %.16e Hz\n", __func__, pow (2.*rMerger, -3. / 2.)/(
LAL_PI * mTScaled));
1358 memcpy (s1Data, spin1,
sizeof (s1Data));
1359 memcpy (s2Data, spin2,
sizeof (s2Data));
1360 memcpy (s1DataNorm, spin1,
sizeof (s1DataNorm));
1361 memcpy (s2DataNorm, spin2,
sizeof (s2DataNorm));
1365 chiS = 0.5 * (spin1[2] + spin2[2]);
1366 chiA = 0.5 * (spin1[2] - spin2[2]);
1368 for (
i = 0;
i < 3;
i++)
1370 s1Data[
i] *= m1 * m1;
1371 s2Data[
i] *= m2 * m2;
1373 for (
i = 0;
i < 3;
i++)
1375 s1DataNorm[
i] = s1Data[
i] / mTotal / mTotal;
1376 s2DataNorm[
i] = s2Data[
i] / mTotal / mTotal;
1378 seobParams.
s1Vec = &s1VecOverMtMt;
1379 seobParams.
s2Vec = &s2VecOverMtMt;
1382 cartPosVec.
data = cartPosData;
1383 cartMomVec.
data = cartMomData;
1384 memset (cartPosData, 0,
sizeof (cartPosData));
1385 memset (cartMomData, 0,
sizeof (cartMomData));
1409 switch (SpinAlignedEOBversion)
1415 tplspin = (1. - 2. * eta) * chiS + (m1 - m2) / (m1 + m2) * chiA;
1418 tplspin = (1. - 2. * eta) * chiS + (m1 - m2) / (m1 + m2) * chiA;
1422 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1, v2, and v4 are available.\n",
1441 seobParams.
a =
a = sigmaKerr->
data[2];
1442 seobParams.
chi1 = spin1[2];
1443 seobParams.
chi2 = spin2[2];
1447 (&seobCoeffs, eta,
a, SpinAlignedEOBversion) ==
XLAL_FAILURE)
1459 (&hCoeffs, &seobParams, m1, m2, eta, tplspin, chiS, chiA,
1480 switch (SpinAlignedEOBversion)
1528 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1, v2, and v4 are available.\n",
1564 (tmpValues, m1, m2, fStart, 0, s1Data, s2Data, &seobParams,
1581 tmpValues->
data[0] = 20;
1582 tmpValues->
data[3] = -0.0001008684225106323/eta;
1583 tmpValues->
data[4] = 1.16263606988612/eta / tmpValues->
data[0];
1593 values->
data[0] = tmpValues->
data[0];
1594 values->
data[1] = 0.;
1595 values->
data[2] = tmpValues->
data[3];
1596 values->
data[3] = tmpValues->
data[0] * tmpValues->
data[4];
1598 eobParams.
rad = values->
data[0];
1607 INT4 postAdiabaticOutcome = 0;
1609 if (postAdiabaticFlag)
1618 SpinAlignedEOBversion,
1622 ), postAdiabaticOutcome);
1626 postAdiabaticFlag=0;
1637 values->
data[0] = dynamicsPA->
data[2*rSize-1];
1638 values->
data[1] = 0.;
1639 values->
data[2] = dynamicsPA->
data[4*rSize-1];
1640 values->
data[3] = dynamicsPA->
data[5*rSize-1];
1642 eobParams.
rad = values->
data[0];
1649 REAL8 odeStep = 1.0;
1651 if(postAdiabaticFlag)
1654 odeStep = fmax(5*
deltaT/mTScaled,1);
1658 odeStep =
deltaT/mTScaled;
1661 nStepBack = ceil (tStepBack / odeStep/ mTScaled);
1664 printf(
"Begin integration\n");
1666 if ( use_tidal == 1 ) {
1678 if (use_optimized_v2_or_v4)
1694 if(postAdiabaticFlag){
1723 if (use_optimized_v2_or_v4)
1726 retLen_fromOptStep2 =
1732 if (retLen_fromOptStep2 ==
XLAL_FAILURE || !dynamicstmp)
1739 retLen_fromOptStep2,
1751 20. / mTScaled, odeStep,
1765 INT4 combinedLenForInterp = 0;
1767 if (postAdiabaticFlag && postAdiabaticOutcome ==
XLAL_SUCCESS)
1780 for (
i = 0;
i < PALen;
i++)
1783 rVecInterp->
data[
i] = dynamicsPA->
data[PALen +
i];
1784 phiVecInterp->
data[
i] = dynamicsPA->
data[2*PALen +
i];
1785 prVecInterp->
data[
i] = dynamicsPA->
data[3*PALen +
i];
1786 pphiVecInterp->
data[
i] = dynamicsPA->
data[4*PALen +
i];
1792 for (
i = 0;
i < PALen;
i++)
1794 interpDynamicsPA->
data[
i] = tVecInterp->
data[
i];
1795 interpDynamicsPA->
data[PALen +
i] = rVecInterp->
data[
i];
1796 interpDynamicsPA->
data[2*PALen +
i] = phiVecInterp->
data[
i];
1797 interpDynamicsPA->
data[3*PALen +
i] = prVecInterp->
data[
i];
1798 interpDynamicsPA->
data[4*PALen +
i] = pphiVecInterp->
data[
i] = dynamicsPA->
data[4*PALen +
i];
1801 REAL8 tOffset = interpDynamicsPA->
data[PALen - 1];
1802 REAL8 phiOffset = interpDynamicsPA->
data[3*PALen - 1];
1804 const INT4 combinedLen = PALen + retLen - 1;
1806 combinedLenForInterp = ceil((dynamics->
data[retLen-1]+tOffset-dynamicsPA->
data[0]) / tStepInterp) - 1;
1816 for (
i = 0;
i < PALen;
i++)
1818 combinedDynamics->
data[
i] = interpDynamicsPA->
data[
i];
1819 combinedDynamics->
data[combinedLen +
i] = interpDynamicsPA->
data[PALen +
i];
1820 combinedDynamics->
data[2*combinedLen +
i] = interpDynamicsPA->
data[2*PALen +
i];
1821 combinedDynamics->
data[3*combinedLen +
i] = interpDynamicsPA->
data[3*PALen +
i];
1822 combinedDynamics->
data[4*combinedLen +
i] = interpDynamicsPA->
data[4*PALen +
i];
1825 for (
i = 1;
i < retLen;
i++)
1827 combinedDynamics->
data[PALen +
i - 1] = dynamics->
data[
i] + tOffset;
1828 combinedDynamics->
data[combinedLen + PALen +
i - 1] = dynamics->
data[retLen +
i];
1829 combinedDynamics->
data[2*combinedLen + PALen +
i - 1] = dynamics->
data[2*retLen +
i] + phiOffset;
1830 combinedDynamics->
data[3*combinedLen + PALen +
i - 1] = dynamics->
data[3*retLen +
i];
1831 combinedDynamics->
data[4*combinedLen + PALen +
i - 1] = dynamics->
data[4*retLen +
i];
1835 dynamics = combinedDynamics;
1837 retLen = combinedLen;
1839 values->
data[0] = dynamics->
data[retLen];
1840 values->
data[1] = dynamics->
data[2*retLen];
1841 values->
data[2] = dynamics->
data[3*retLen];
1842 values->
data[3] = dynamics->
data[4*retLen];
1844 eobParams.
rad = values->
data[0];
1876 rVec.
data = dynamics->
data + retLen;
1879 phiVec.
data = dynamics->
data + 2 * retLen;
1880 prVec.
data = dynamics->
data + 3 * retLen;
1881 pPhiVec.
data = dynamics->
data + 4 * retLen;
1887 if (tStepBack > retLen * odeStep*mTScaled)
1889 tStepBack = 0.5 * retLen * odeStep*mTScaled;
1890 nStepBack = ceil (tStepBack / odeStep/mTScaled);
1895 INT4 retLen_out = retLen;
1904 hiSRndx = retLen - nStepBack;
1917 values->
data[0] = rVec.
data[hiSRndx];
1918 values->
data[1] = phiVec.
data[hiSRndx];
1919 values->
data[2] = prVec.
data[hiSRndx];
1920 values->
data[3] = pPhiVec.
data[hiSRndx];
1924 eobParams.
rad = values->
data[0];
1939 REAL8 tstartHi = 0.0;
1940 if (postAdiabaticFlag && postAdiabaticOutcome ==
XLAL_SUCCESS)
1944 REAL8 tTarget = tVec.
data[retLen-1]-tStepBack/mTScaled;
1947 tstartHi = closestTime;
1950 eobParams.
rad = values->
data[0];
1955 if (SpinAlignedEOBversion == 4)
1959 if ( use_tidal == 1 ) {
1963 if (use_optimized_v2_or_v4)
1966 retLen_fromOptStep3 =
1970 deltaTHigh / mTScaled, 0.,
1972 if (retLen_fromOptStep3 ==
XLAL_FAILURE || !dynamicsHitmp)
1978 deltaTHigh / mTScaled,
1979 retLen_fromOptStep3,
1987 20. / mTScaled, deltaTHigh / mTScaled,
2011 INT4 retLenHi_out = retLen;
2015 if(!postAdiabaticFlag)
2017 tstartHi = hiSRndx * odeStep;
2028 rHi.
data = dynamicsHi->
data + retLen;
2029 phiHi.
data = dynamicsHi->
data + 2 * retLen;
2030 prHi.
data = dynamicsHi->
data + 3 * retLen;
2031 pPhiHi.
data = dynamicsHi->
data + 4 * retLen;
2033 REAL8 domega220 = 0;
2035 REAL8 domega210 = 0;
2037 REAL8 domega330 = 0;
2039 REAL8 domega440 = 0;
2041 REAL8 domega550 = 0;
2065 (
UINT4) ceil (20 * (1. + dtau220) /
2066 (cimag (modeFreq) * deltaTHigh)));
2069 (
UINT4) ceil (20 * (1. + dtau220) /
2070 (cimag (modeFreq) * deltaTHigh)));
2073 (
UINT4) ceil (20 * (1. + dtau220) /
2074 (cimag (modeFreq) * deltaTHigh)));
2077 (
UINT4) ceil (20 * (1. + dtau220) /
2078 (cimag (modeFreq) * deltaTHigh)));
2085 (cimag (modeFreq) * deltaTHigh)));
2089 (cimag (modeFreq) * deltaTHigh)));
2093 (cimag (modeFreq) * deltaTHigh)));
2097 (cimag (modeFreq) * deltaTHigh)));
2107 if (!sigReHi || !sigImHi || !omegaHi || !ampNQC || !phaseNQC|| !hamVHi)
2124 memset (sigReHi->
data, 0, sigReHi->
length * sizeof (sigReHi->
data[0]));
2125 memset (sigImHi->data, 0, sigImHi->length * sizeof (sigImHi->data[0]));
2128 REAL8 omegaOld = 0.0;
2129 INT4 phaseCounter = 0;
2130 for (
i = 0;
i < retLen;
i++)
2137 if (use_optimized_v2_or_v4)
2148 if(postAdiabaticFlag){
2158 if (omega < 1.0e-15)
2160 omegaHi->
data[
i] = omega;
2163 if (postAdiabaticFlag){
2167 cartPosVec.
data[0] = values->
data[0];
2168 cartMomVec.
data[0] = values->
data[2];
2169 cartMomVec.
data[1] = values->
data[3] / values->
data[0];
2171 if (use_optimized_v2_or_v4)
2178 &s2VecOverMtMt, sigmaKerr,
2188 &s1VecOverMtMt, &s2VecOverMtMt,
2189 sigmaKerr, sigmaStar,
2193 if (omega <= omegaOld && !peakIdx)
2201 finalIdx = retLen - 1;
2207 FILE *out = fopen (
"saDynamicsHi.dat",
"w");
2208 for (
i = 0;
i < retLen;
i++)
2210 fprintf (out,
"%.16e %.16e %.16e %.16e %.16e %.16e\n", timeHi.
data[
i],
2221 gsl_spline *spline = NULL;
2222 gsl_interp_accel *acc = NULL;
2225 REAL8 timePeak, timewavePeak = 0., omegaDerivMid;
2226 REAL8 sigAmpSqHi = 0., oldsigAmpSqHi = 0.;
2229 spline = gsl_spline_alloc (gsl_interp_cspline, retLen);
2230 acc = gsl_interp_accel_alloc ();
2232 time1 = dynamicsHi->
data[peakIdx];
2234 gsl_spline_init (spline, dynamicsHi->
data, omegaHi->
data, retLen);
2235 omegaDeriv1 = gsl_spline_eval_deriv (spline, time1, acc);
2236 if (omegaDeriv1 > 0.)
2238 time2 = dynamicsHi->
data[peakIdx + 1];
2245 time1 = dynamicsHi->
data[peakIdx - 1];
2247 omegaDeriv1 = gsl_spline_eval_deriv (spline, time1, acc);
2252 timePeak = (time1 + time2) / 2.;
2253 omegaDerivMid = gsl_spline_eval_deriv (spline, timePeak, acc);
2255 if (omegaDerivMid * omegaDeriv1 < 0.0)
2262 omegaDeriv1 = omegaDerivMid;
2266 while (time2 - time1 > 1.0e-5);
2272 gsl_spline_free( spline );
2273 gsl_interp_accel_free( acc );
2305 switch (SpinAlignedEOBversion)
2319 (
"XLAL Error - %s: Unknown SEOBNR version!\nAt present only v1 and v2 are available.\n",
2357 if (use_tidal == 1) {
2365 gsl_matrix * nqcCoeffsMatrix = gsl_matrix_alloc (
nModes, 10);
2372 (&hCoeffs, &seobParams, m1, m2, eta, tplspin, chiS, chiA,
2410 if((fabs(m1-m2) == 0) && (chiA == 0)){
2417 omegaHi,hamVHi,&pPhiHi,timePeak -timewavePeak,m1,m2,chiS,chiA,deltaTHigh / mTScaled);
2419 omegaHi,hamVHi,&pPhiHi,timePeak -timewavePeak- 10,m1,m2,chiS,chiA,deltaTHigh / mTScaled);
2435 char filename2[
sizeof "saModesXXHi.dat"];
2436 sprintf(filename2,
"saModes%01d%01dHi.dat",modeL,modeM);
2437 out = fopen (filename2,
"w");
2439 for(
i=0;
i<retLen;
i++){
2444 v = cbrt (omegaHi->
data[
i]);
2445 if (postAdiabaticFlag)
2448 vPhiVecHi->
data[
i]);
2453 use_optimized_v2_or_v4);
2498 creal (hLM) , cimag (hLM ) );
2500 ampNQC->
data[
i] = cabs (hLM);
2501 sigReHi->
data[
i] = (
REAL8) (amp0 * creal (hLM));
2502 sigImHi->data[
i] = (
REAL8) (amp0 * cimag (hLM));
2503 phaseNQC->data[
i] = carg (hLM) + phaseCounter *
LAL_TWOPI;
2505 if (
i && phaseNQC->data[
i] > phaseNQC->data[
i - 1])
2519 if (SpinAlignedEOBversion == 4)
2521 if ( use_tidal == 1 && nqcFlag == 2 ) {
2522 nqcCoeffs.
a1 = nqcCoeffsInput->
data[0];
2523 nqcCoeffs.
a2 = nqcCoeffsInput->
data[1];
2524 nqcCoeffs.
a3 = nqcCoeffsInput->
data[2];
2525 nqcCoeffs.
a3S = nqcCoeffsInput->
data[3];
2526 nqcCoeffs.
a4 = nqcCoeffsInput->
data[4];
2527 nqcCoeffs.
a5 = nqcCoeffsInput->
data[5];
2528 nqcCoeffs.
b1 = nqcCoeffsInput->
data[6];
2529 nqcCoeffs.
b2 = nqcCoeffsInput->
data[7];
2530 nqcCoeffs.
b3 = nqcCoeffsInput->
data[8];
2531 nqcCoeffs.
b4 = nqcCoeffsInput->
data[9];
2534 if(eta == 0.25 && chiA == 0 && ( (modeL == 2 && modeM == 1) || (modeL == 3 && modeM == 3)|| (modeL == 5 && modeM == 5) ) ) {
2548 (ampNQC, phaseNQC, &rHi, &prHi, omegaHi, modeL, modeM, timePeak,
2549 deltaTHigh / mTScaled, m1, m2, chiA, chiS, &nqcCoeffs) ==
XLAL_FAILURE)
2593 if ( SpinAlignedEOBversion == 4 && nqcFlag == 1 ) {
2594 nqcCoeffsInput->
data[0] = nqcCoeffs.
a1;
2595 nqcCoeffsInput->
data[1] = nqcCoeffs.
a2;
2596 nqcCoeffsInput->
data[2] = nqcCoeffs.
a3;
2597 nqcCoeffsInput->
data[3] = nqcCoeffs.
a3S;
2598 nqcCoeffsInput->
data[4] = nqcCoeffs.
a4;
2599 nqcCoeffsInput->
data[5] = nqcCoeffs.
a5;
2600 nqcCoeffsInput->
data[6] = nqcCoeffs.
b1;
2601 nqcCoeffsInput->
data[7] = nqcCoeffs.
b2;
2602 nqcCoeffsInput->
data[8] = nqcCoeffs.
b3;
2603 nqcCoeffsInput->
data[9] = nqcCoeffs.
b4;
2635 (
"Tidal point-mass NQC should not be 0 here: %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e\n",
2636 nqcCoeffs.
a1, nqcCoeffs.
a2, nqcCoeffs.
a3, nqcCoeffs.
a3S, nqcCoeffs.
a4,
2637 nqcCoeffs.
a5, nqcCoeffs.
b1, nqcCoeffs.
b2, nqcCoeffs.
b3, nqcCoeffs.
b4);
2642 gsl_matrix_set(nqcCoeffsMatrix,k,0, nqcCoeffs.
a1);
2643 gsl_matrix_set(nqcCoeffsMatrix,k,1, nqcCoeffs.
a2);
2644 gsl_matrix_set(nqcCoeffsMatrix,k,2, nqcCoeffs.
a3);
2645 gsl_matrix_set(nqcCoeffsMatrix,k,3, nqcCoeffs.
a3S);
2646 gsl_matrix_set(nqcCoeffsMatrix,k,4, nqcCoeffs.
a4);
2647 gsl_matrix_set(nqcCoeffsMatrix,k,5, nqcCoeffs.
a5);
2648 gsl_matrix_set(nqcCoeffsMatrix,k,6, nqcCoeffs.
b1);
2649 gsl_matrix_set(nqcCoeffsMatrix,k,7, nqcCoeffs.
b2);
2650 gsl_matrix_set(nqcCoeffsMatrix,k,8, nqcCoeffs.
b3);
2651 gsl_matrix_set(nqcCoeffsMatrix,k,9, nqcCoeffs.
b4);
2654 (
"(%d,%d)-mode NQC should not be 0 here: %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e\n",
2655 modeL, modeM, nqcCoeffs.
a1, nqcCoeffs.
a2, nqcCoeffs.
a3, nqcCoeffs.
a3S, nqcCoeffs.
a4,
2656 nqcCoeffs.
a5, nqcCoeffs.
b1, nqcCoeffs.
b2, nqcCoeffs.
b3, nqcCoeffs.
b4);
2658 sprintf(filename2,
"NQC%01d%01dHi.dat",modeL,modeM);
2659 NQC = fopen (filename2,
"w");
2660 fprintf(NQC,
"%.16e \n%.16e \n%.16e \n%.16e \n%.16e\n", nqcCoeffs.
a1, nqcCoeffs.
a2, nqcCoeffs.
a3,nqcCoeffs.
b1, nqcCoeffs.
b2);
2667 char filename[
sizeof "saModesXXHiNQC.dat"];
2668 sprintf(
filename,
"saModes%01d%01dHiNQC.dat",modeL,modeM);
2671 for (
i = 0;
i < retLen;
i++)
2719 hLM = sigReHi->
data[
i];
2720 hLM += I * sigImHi->data[
i];
2722 if ( (lambda2Tidal1 != 0. && omega02Tidal1 != 0.) || (lambda2Tidal2 != 0. && omega02Tidal2 != 0.) ) {
2724 (&hT, values, cbrt(omegaHi->
data[
i]), 2, 2, &seobParams) )
2732 sigImHi->data[
i] = (
REAL8) cimag (hLM);
2737 hLMAllHi->
data[(1+2*k)*sigReHi->
length +
i] = sigImHi->data[
i];
2739 fprintf (out,
"%.16e %.16e %.16e %.16e %.16e\n", timeHi.
data[
i],
2740 creal (hLM) / amp0, cimag (hLM) / amp0,
2745 if (SpinAlignedEOBversion==1 || SpinAlignedEOBversion==2) {
2746 sigAmpSqHi = creal (hLM) * creal (hLM) + cimag (hLM) * cimag (hLM);
2747 if (sigAmpSqHi < oldsigAmpSqHi && peakCount == 0 && (
i - 1) * deltaTHigh / mTScaled < timePeak-timewavePeak)
2749 timewavePeak = (
i - 1) * deltaTHigh / mTScaled;
2752 oldsigAmpSqHi = sigAmpSqHi;
2757 printf (
"NQCs entering hNQC: %f, %f, %f, %f, %f, %f\n", nqcCoeffs.
a1,
2758 nqcCoeffs.
a2, nqcCoeffs.
a3, nqcCoeffs.
a3S, nqcCoeffs.
a4,
2760 printf (
"NQCs entering hNQC: %f, %f, %f, %f\n", nqcCoeffs.
b1, nqcCoeffs.
b2,
2761 nqcCoeffs.
b3, nqcCoeffs.
b4);
2762 printf (
"Stas, again: timePeak = %.16f, timewavePeak = %.16f \n", timePeak,
2774 if (timewavePeak < 1.0e-16 || peakCount == 0)
2779 timewavePeak = timePeak - timewavePeak;
2794 REAL8 combSize = 7.5;
2796 (spin1[2] + spin2[2]) / 2. +
2797 ((spin1[2] - spin2[2]) / 2.) * ((m1 - m2) / (m1 + m2)) / (1. - 2. * eta);
2803 if (SpinAlignedEOBversion == 2 || SpinAlignedEOBversion == 4)
2805 combSize = (spin1[2] == 0.
2806 && spin2[2] == 0.) ? 11. : ((eta > 10. / 121.
2807 && chi >= 0.8) ? 8.5 : 12.);
2808 if ((eta > 30. / 31. / 31. && eta <= 10. / 121. && chi >= 0.8)
2809 || (eta <= 30. / 31. / 31. && chi >= 0.8 && chi < 0.9))
2813 REAL8 timeshiftPeak;
2814 timeshiftPeak = timePeak - timewavePeak;
2815 if (SpinAlignedEOBversion == 2 || SpinAlignedEOBversion == 4)
2818 (timePeak - timewavePeak) > 0. ? (timePeak - timewavePeak) : 0.;
2867 if (combSize > timePeak - timeshiftPeak)
2873 if (use_tidal == 1) {
2876 REAL8 Anew, Aval = sqrt( sigReHi->
data[0]*sigReHi->
data[0] +sigImHi->data[0]*sigImHi->data[0] );
2878 Anew = sqrt( sigReHi->
data[
i]*sigReHi->
data[
i] +sigImHi->data[
i]*sigImHi->data[
i]);
2879 if ( Aval > Anew ) {
2888 printf(
"indAmax %d\n",indAmax);
2894 REAL8 Avalp = sqrt( sigReHi->
data[1]*sigReHi->
data[1] +sigImHi->data[1]*sigImHi->data[1] );
2895 REAL8 Avalm = sqrt( sigReHi->
data[0]*sigReHi->
data[0] +sigImHi->data[0]*sigImHi->data[0] );
2896 dAval= Avalp - Avalm;
2897 INT4 iSkip = (
INT4) 1./(deltaTHigh / mTScaled);
2899 Avalm = sqrt( sigReHi->
data[
i-1]*sigReHi->
data[
i-1] +sigImHi->data[
i-1]*sigImHi->data[
i-1]);
2900 Avalp = sqrt( sigReHi->
data[
i]*sigReHi->
data[
i] +sigImHi->data[
i]*sigImHi->data[
i]);
2901 dAnew = Avalp - Avalm;
2903 printf(
"%.16e %.16e %.16e\n",
i*deltaTHigh / mTScaled, dAnew, dAval);
2906 if ( dAnew<dAval) peakDet++;
2910 if ( dAnew>dAval ) {
2921 printf(
"indAmax %d\n",indAmax);
2925 REAL8 re = sigReHi->
data[0], im = sigImHi->data[0];
2926 REAL8 red = ( sigReHi->
data[1] - sigReHi->
data[0] ) /
dt, imd = ( sigImHi->data[1] - sigImHi->data[0] ) /
dt;
2927 REAL8 Onew, Oval = - (imd*re - red*im) / (re*re + im*im);
2933 re = sigReHi->
data[
i];
2934 im = sigImHi->data[
i];
2936 imd = ( sigImHi->data[
i+1] - sigImHi->data[
i] ) /
dt;
2937 Onew = - (imd*re - red*im) / (re*re + im*im);
2938 OmVec->
data[
i] = Onew;
2939 if ( Onew >= Oval ) {
2945 if ( indAmax>timeHi.
length/2 && timeHi.
data[indAmax] <= timeHi.
data[indOmax] ) {
2946 timePeak = timeHi.
data[indAmax] ;
2949 timePeak = timeHi.
data[indOmax];
2955 if(!postAdiabaticFlag){
2956 XLALGPSAdd (&tc, -mTScaled * (dynamics->
data[hiSRndx] + timePeak));
2960 rdMatchPoint->
data[0] =
2962 timePeak - timeshiftPeak ? timePeak - timeshiftPeak - combSize : 0;
2964 rdMatchPoint->
data[1] = timePeak - timeshiftPeak;
2965 rdMatchPoint->
data[2] = dynamicsHi->
data[finalIdx];
2967 printf (
"YP::comb range: %f, %f\n", rdMatchPoint->
data[0],
2968 rdMatchPoint->
data[1]);
2970 rdMatchPoint->
data[0] -=
2971 fmod (rdMatchPoint->
data[0], deltaTHigh / mTScaled);
2972 rdMatchPoint->
data[1] -=
2973 fmod (rdMatchPoint->
data[1], deltaTHigh / mTScaled);
2975 printf(
"tattach = %.16f\n", rdMatchPoint->
data[1]);
2977 UINT4 indAmpMax = 0;
2985 if((modeL == 5)&&(modeM==5)){
2986 rdMatchPoint->
data[3] = timePeak - timeshiftPeak-10;
2987 rdMatchPoint->
data[3] -= fmod (rdMatchPoint->
data[3], deltaTHigh / mTScaled);
2990 for (
i=0;
i<retLen;
i++ ) {
2992 sigImHi->data[
i] = hLMAllHi->
data[
i + (2*k+1)*sigReHi->
length];
2995 sigReHi->
data[
i] = 0.;
2996 sigImHi->data[
i] = 0.;
2999 if ( use_tidal == 1 ) {
3001 REAL8 dtGeom = deltaTHigh / mTScaled;
3008 UINT4 iM = iEnd - 1000;
3011 REAL8 omegaMdot = (OmVec->
data[iM]-OmVec->
data[iM-10])/(10*dtGeom);
3014 for (kount=0; kount<iEnd; kount++){
3015 ampl->
data[kount] = sqrt(sigReHi->
data[kount]/amp0*sigReHi->
data[kount]/amp0 + sigImHi->data[kount]/amp0*sigImHi->data[kount]/amp0)/(1. + exp((kount*dtGeom-rdMatchPoint->
data[1]-15)/
tau));
3016 phtmp->
data[kount] = carg(sigReHi->
data[kount] + I * sigImHi->data[kount]);
3018 REAL8 amplEnd = sqrt(sigReHi->
data[iEnd]/amp0*sigReHi->
data[iEnd]/amp0 + sigImHi->data[iEnd]/amp0*sigImHi->data[iEnd]/amp0);
3019 REAL8 amplEndM1 = sqrt(sigReHi->
data[iEnd-1]/amp0*sigReHi->
data[iEnd-1]/amp0 + sigImHi->data[iEnd-1]/amp0*sigImHi->data[iEnd-1]/amp0);
3020 REAL8 ampldotEnd = (amplEnd-amplEndM1)/dtGeom;
3021 if ( ampldotEnd < 0. ) ampldotEnd = 0.;
3022 for (kount=iEnd;kount<(
INT4)(sigReHi->
length);kount++){
3023 ampl->
data[kount] = (amplEnd + ampldotEnd*(kount - iEnd)*dtGeom)/(1. + exp((kount*dtGeom-rdMatchPoint->
data[1]-15)/
tau));
3026 phtmp->
data[kount] = phtmp->
data[iM] - ( omega0*(kount-(
INT4)iM)*dtGeom + (omega0-omegaM)*(omega0-omegaM)/omegaMdot*(exp(-(kount-(
INT4)iM)*dtGeom/(omega0-omegaM)*omegaMdot) - 1.) );
3029 FILE *testout = fopen (
"test.dat",
"w");
3030 for (kount=0;kount<(
INT4)(sigReHi->
length);kount++){
3031 fprintf(testout,
"%.16e %.16e %.16e %.16e %.16e %.16e %.16e\n", kount*dtGeom,ampl->
data[kount],phtmp->
data[kount],sigReHi->
data[kount],sigImHi->data[kount],sqrt(sigReHi->
data[kount]/amp0*sigReHi->
data[kount]/amp0 + sigImHi->data[kount]/amp0*sigImHi->data[kount]/amp0),carg(sigReHi->
data[kount] + I * sigImHi->data[kount]));
3035 for (kount=0;kount<(
INT4)(sigReHi->
length);kount++){
3036 sigReHi->
data[kount] = amp0*ampl->
data[kount]*cos(phtmp->
data[kount]);
3037 sigImHi->data[kount] = amp0*ampl->
data[kount]*sin(phtmp->
data[kount]);
3055 if (SpinAlignedEOBversion == 1 || SpinAlignedEOBversion == 2)
3058 deltaTHigh, m1, m2, spin1[0],
3059 spin1[1], spin1[2], spin2[0],
3060 spin2[1], spin2[2], &timeHi,
3062 SpinAlignedEOBapproximant) ==
3068 else if (SpinAlignedEOBversion == 4)
3071 sigReHi, sigImHi, modeL, modeM,
3073 spin1[0], spin1[1], spin1[2],
3074 spin2[0], spin2[1], spin2[2],
3083 SpinAlignedEOBapproximant, &indAmpMax) ==
3130 hLMAllHi->
data[(1+2*k)*sigReHi->
length +
i] = sigImHi->data[
i];
3133 char filename[
sizeof "saModesXXHiIMR.dat"];
3134 sprintf(
filename,
"saModes%01d%01dHiIMR.dat",modeL,modeM);
3137 fprintf (out,
"%.16e %.16e %.16e\n",
i*deltaTHigh / mTScaled,hLMAllHi->
data[2*k*sigReHi->
length +
i]/amp0,hLMAllHi->
data[(1+2*k)*sigReHi->
length +
i]/amp0);
3150 if (use_optimized_v2_or_v4)
3170 retLen_fromOptStep2,
3174 ampVec.
data = dynamics->
data + 5 * retLen;
3175 phaseVec.
data = dynamics->
data + 6 * retLen;
3181 deltaTHigh / mTScaled,
3182 retLen_fromOptStep3,
3190 if(postAdiabaticFlag && postAdiabaticOutcome ==
XLAL_SUCCESS){
3201 memset (sigImVec->data, 0, sigImVec->length * sizeof (
REAL8));
3207 memset (sigReCoorbVec->
data, 0, sigReCoorbVec->
length * sizeof (
REAL8));
3208 memset (sigImCoorbVec->
data, 0, sigImCoorbVec->
length * sizeof (
REAL8));
3217 if (use_optimized_v2_or_v4)
3222 hLM = ampVec.
data[
i] * cexp (I * phaseVec.
data[
i]);
3224 sigReVec->
data[
i] = amp0 * creal (hLM);
3225 sigImVec->data[
i] = amp0 * cimag (hLM);
3227 hLMAll->
data[sigReVec->
length +
i] = sigImVec->data[
i];
3233 out = fopen (
"saDynamics.dat",
"w");
3244 if (!omegaVec|| !hamV)
3303 if (postAdiabaticFlag){
3315 fprintf (out,
"%.16e %.16e %.16e %.16e %.16e %.16e\n", dynamics->
data[
i],
3319 cartPosVec.
data[0] = values->
data[0];
3320 cartMomVec.
data[0] = values->
data[2];
3321 cartMomVec.
data[1] = values->
data[3] / values->
data[0];
3323 if(postAdiabaticFlag){
3326 &s1VecOverMtMt, &s2VecOverMtMt,
3327 sigmaKerr, sigmaStar,
3333 &s1VecOverMtMt, &s2VecOverMtMt,
3334 sigmaKerr, sigmaStar,
3341 UNUSED gsl_interp_accel *acc_re = gsl_interp_accel_alloc();
3342 gsl_spline *spline_re = gsl_spline_alloc(gsl_interp_cspline, rVec.
length);
3343 UNUSED gsl_interp_accel *acc_im = gsl_interp_accel_alloc();
3344 gsl_spline *spline_im = gsl_spline_alloc(gsl_interp_cspline, rVec.
length);
3346 UNUSED gsl_interp_accel *acc_orbphase = gsl_interp_accel_alloc();
3347 gsl_spline *spline_orbphase = gsl_spline_alloc(gsl_interp_cspline, rVec.
length);
3348 gsl_spline_init(spline_orbphase, tVec.
data, phiVec.
data, rVec.
length);
3355 nqcCoeffs.
a1 = gsl_matrix_get(nqcCoeffsMatrix,k,0);
3356 nqcCoeffs.
a2 = gsl_matrix_get(nqcCoeffsMatrix,k,1);
3357 nqcCoeffs.
a3 = gsl_matrix_get(nqcCoeffsMatrix,k,2);
3358 nqcCoeffs.
a3S = gsl_matrix_get(nqcCoeffsMatrix,k,3);
3359 nqcCoeffs.
a4 = gsl_matrix_get(nqcCoeffsMatrix,k,4);
3360 nqcCoeffs.
a5 = gsl_matrix_get(nqcCoeffsMatrix,k,5);
3361 nqcCoeffs.
b1 = gsl_matrix_get(nqcCoeffsMatrix,k,6);
3362 nqcCoeffs.
b2 = gsl_matrix_get(nqcCoeffsMatrix,k,7);
3363 nqcCoeffs.
b3 = gsl_matrix_get(nqcCoeffsMatrix,k,8);
3364 nqcCoeffs.
b4 = gsl_matrix_get(nqcCoeffsMatrix,k,9);
3367 (
"(%d,%d)-mode NQC should not be 0 here: %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e %.16e\n",
3368 modeL, modeM, nqcCoeffs.
a1, nqcCoeffs.
a2, nqcCoeffs.
a3, nqcCoeffs.
a3S, nqcCoeffs.
a4,
3369 nqcCoeffs.
a5, nqcCoeffs.
b1, nqcCoeffs.
b2, nqcCoeffs.
b3, nqcCoeffs.
b4);
3377 if(postAdiabaticFlag){
3381 cbrt (omegaVec->
data[
i]),
3446 if ( (lambda2Tidal1 != 0. && omega02Tidal1 != 0.) || (lambda2Tidal2 != 0. && omega02Tidal2 != 0.) ) {
3448 (&hT, values, cbrt (omegaVec->
data[
i]), 2, 2, &seobParams)
3510 REAL8 dtGeom = deltaTHigh / mTScaled;
3515 sigReVec->
data[
i] = amp0 * creal (hLM)/(1. + exp((
i*dtGeomLow - (rdMatchPoint->
data[1]+15 + (dynamics->
data)[hiSRndx]) )/
tau));
3516 sigImVec->data[
i] = amp0 * cimag (hLM)/(1. + exp((
i*dtGeomLow - (rdMatchPoint->
data[1] +15 + (dynamics->
data)[hiSRndx]))/
tau));
3519 sigReVec->
data[
i] = amp0 * creal (hLM);
3520 sigImVec->data[
i] = amp0 * cimag (hLM);
3521 if(postAdiabaticFlag && postAdiabaticOutcome ==
XLAL_SUCCESS){
3529 sigReCoorbVec->
data[
i] = sigReVec->
data[
i]*cos(modeM*phiVec.
data[
i])-sigImVec->data[
i]*sin(modeM*phiVec.
data[
i]);
3530 sigImCoorbVec->
data[
i] = sigReVec->
data[
i]*sin(modeM*phiVec.
data[
i])+sigImVec->data[
i]*cos(modeM*phiVec.
data[
i]);
3534 if(!postAdiabaticFlag){
3536 hLMAll->
data[(1+2*k)*sigReVec->
length +
i] = sigImVec->data[
i];
3539 if(postAdiabaticFlag && postAdiabaticOutcome ==
XLAL_SUCCESS){
3542 gsl_spline_init(spline_re, tVec.
data, sigReCoorbVec->
data, rVec.
length);
3545 gsl_spline_init(spline_im, tVec.
data, sigImCoorbVec->
data, rVec.
length);
3550 REAL8 re_temp = 0.0;
3551 REAL8 im_temp = 0.0;
3553 REAL8 phase_temp = 0.0;
3558 double x_lo_old = 0, y_lo_old = 0, b_i_old = 0, c_i_old = 0, d_i_old = 0;
3559 double x_lo_old2 = 0, y_lo_old2 = 0, b_i_old2 = 0, c_i_old2 = 0, d_i_old2 = 0;
3560 double x_lo_old3 = 0, y_lo_old3 = 0, b_i_old3 = 0, c_i_old3 = 0, d_i_old3 = 0;
3561 unsigned int index_old = 0, index_old2 = 0, index_old3 = 0;
3564 for (
i = 0;
i < combinedLenForInterp;
i++)
3574 &index_old, &x_lo_old, &y_lo_old,
3575 &b_i_old, &c_i_old, &d_i_old);
3577 &index_old2, &x_lo_old2, &y_lo_old2,
3578 &b_i_old2, &c_i_old2, &d_i_old2);
3581 &index_old3, &x_lo_old3, &y_lo_old3,
3582 &b_i_old3, &c_i_old3, &d_i_old3);
3583 cm = cos(modeM * phase_temp);
3584 sm = sin(modeM * phase_temp);
3587 re_In = re_temp * cm + im_temp * sm;
3588 im_In = -re_temp * sm + im_temp * cm;
3589 hLMAll->
data[2 * k * sigReVec->
length +
i] = re_In;
3590 hLMAll->
data[(1 + 2 * k) * sigReVec->
length +
i] = im_In;
3591 if (t_i > tstartHi && idx == 0)
3605 gsl_spline_free( spline_orbphase);
3606 gsl_interp_accel_free( acc_orbphase );
3607 gsl_spline_free( spline_re);
3608 gsl_interp_accel_free( acc_re );
3609 gsl_spline_free( spline_im);
3610 gsl_interp_accel_free( acc_im );
3627 if(postAdiabaticFlag){
3634 hLMAll->
data[(2*k+1)*sigReVec->
length +
i + hiSRndx] = hLMAllHi->
data[(2*k+1)*sigReHi->
length +
i*resampFac];
3645 if ( fStart != fMin ) {
3647 gsl_spline *splineRe = NULL;
3648 gsl_interp_accel *accRe = NULL;
3649 gsl_spline *splineIm = NULL;
3650 gsl_interp_accel *accIm = NULL;
3654 sigImVec->data[
i] = hLMAll->
data[sigReVec->
length +
i];
3659 tmpIm->data[
i] = sigImVec->data[
i] / amp0;
3661 splineRe = gsl_spline_alloc (gsl_interp_cspline, sigReVec->
length);
3662 splineIm = gsl_spline_alloc (gsl_interp_cspline, sigImVec->length);
3663 accRe = gsl_interp_accel_alloc ();
3664 accIm = gsl_interp_accel_alloc ();
3671 gsl_spline_init (splineRe, timeList->
data, tmpRe->
data, tmpRe->
length);
3672 gsl_spline_init (splineIm, timeList->
data, tmpIm->data, tmpIm->length);
3675 norm = tmpRe->
data[
i]*tmpRe->
data[
i] + tmpIm->data[
i]*tmpIm->data[
i];
3677 dRe = gsl_spline_eval_deriv (splineRe, timeList->
data[
i], accRe);
3678 dIm = gsl_spline_eval_deriv (splineIm, timeList->
data[
i], accIm);
3679 finst = (dRe*tmpIm->data[
i] - dIm*tmpRe->
data[
i])/norm;
3681 finst = finst/(2.*
LAL_PI*mTScaled);
3683 if ( finst > fMin ) {
3692 gsl_spline_free( splineRe );
3693 gsl_interp_accel_free( accRe );
3694 gsl_spline_free( splineIm );
3695 gsl_interp_accel_free( accIm );
3705 char filename[
sizeof "saModesXXIMR.dat"];
3706 sprintf(
filename,
"saModes%01d%01dIMR.dat",modeL,modeM);
3729 snprintf(mode_name,
sizeof(mode_name),
"(%d, %d) mode", modeL, modeM);
3760 gsl_matrix_free (nqcCoeffsMatrix);
3808 for (
i = 0;
i < 5*retLen_out;
i++) (*dynamics_out)->data[
i] = dynamics->
data[
i];
3810 for (
i = 0;
i < retLenHi_out;
i++) (*dynamicsHi_out)->data[
i] = tstartHi + dynamicsHi->
data[
i];
3811 for (
i = retLenHi_out;
i < 5*retLenHi_out;
i++) (*dynamicsHi_out)->data[
i] = dynamicsHi->
data[
i];
3847 UINT4 SpinAlignedEOBversion,
3849 const REAL8 lambda2Tidal1,
3851 const REAL8 lambda2Tidal2,
3853 const REAL8 omega02Tidal1,
3855 const REAL8 omega02Tidal2,
3857 const REAL8 lambda3Tidal1,
3859 const REAL8 lambda3Tidal2,
3861 const REAL8 omega03Tidal1,
3863 const REAL8 omega03Tidal2,
3865 const REAL8 quadparam1,
3867 const REAL8 quadparam2,
3873 LALValue *ModeArray,
3880 REAL8 coa_phase = phiC;
3894 &dynamics, &dynamicsHi,
3900 SpinAlignedEOBversion,
3901 lambda2Tidal1, lambda2Tidal2,
3902 omega02Tidal1, omega02Tidal2,
3903 lambda3Tidal1, lambda3Tidal2,
3904 omega03Tidal1, omega03Tidal2,
3905 quadparam1, quadparam2,
3906 nqcCoeffsInput, nqcFlag,
3938 while ( hlms_temp ) {
3950 hlms_temp = hlms_temp->
next;
3957 (*hcross) = hCrossTS;
int XLALDictContains(const LALDict *dict, const char *key)
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
int XLALDictInsertUINT4Value(LALDict *dict, const char *key, UINT4 value)
int XLALDictInsertUINT2Value(LALDict *dict, const char *key, UINT2 value)
UINT2 XLALDictLookupUINT2Value(LALDict *dict, const char *key)
int XLALDictInsertREAL8Value(LALDict *dict, const char *key, REAL8 value)
Module to compute the ring-down waveform as linear combination of quasi-normal-modes decaying wavefor...
static UNUSED INT4 XLALSimIMREOBAttachFitRingdown(REAL8Vector *signal1, REAL8Vector *signal2, const INT4 l, const INT4 m, const REAL8 dt, const REAL8 mass1, const REAL8 mass2, const REAL8 spin1x, const REAL8 spin1y, const REAL8 spin1z, const REAL8 spin2x, const REAL8 spin2y, const REAL8 spin2z, const REAL8 domega220, const REAL8 dtau220, const REAL8 domega210, const REAL8 dtau210, const REAL8 domega330, const REAL8 dtau330, const REAL8 domega440, const REAL8 dtau440, const REAL8 domega550, const REAL8 dtau550, const UINT2 TGRflag, REAL8Vector *timeVec, REAL8Vector *matchrange, Approximant approximant, UINT4 *indAmpMax)
The main function for performing the ringdown attachment for SEOBNRv4 (and beyond) This is the functi...
static UNUSED INT4 XLALSimIMREOBHybridAttachRingdown(REAL8Vector *signal1, REAL8Vector *signal2, const INT4 l, const INT4 m, const REAL8 dt, const REAL8 mass1, const REAL8 mass2, const REAL8 spin1x, const REAL8 spin1y, const REAL8 spin1z, const REAL8 spin2x, const REAL8 spin2y, const REAL8 spin2z, REAL8Vector *timeVec, REAL8Vector *matchrange, Approximant approximant)
The main workhorse function for performing the ringdown attachment for EOB models EOBNRv2 and SEOBNRv...
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 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 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 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 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 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 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 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 UNUSED int XLALSimIMREOBComputeNewtonMultipolePrefixes(NewtonMultipolePrefixes *prefix, const REAL8 m1, const REAL8 m2)
Function which computes the various coefficients in the Newtonian multipole.
const UINT4 lmModes[NMODES][2]
UNUSED REAL8 XLALSimNSNSMergerFreq(TidalEOBParams *tidal1, TidalEOBParams *tidal2)
NR fit to the geometric GW frequency M_{total}omega_{22} of a BNS merger, defined by the time when th...
static int UNUSED XLALEOBSpinStopCondition(double UNUSED t, const double values[], double dvalues[], void *funcParams)
static int XLALSpinAlignedNSNSStopCondition(double UNUSED t, const double UNUSED values[], double dvalues[], void UNUSED *funcParams)
This function defines the stopping criteria for the tidal EOB model Note that here values[0] = r valu...
static INT4 IntrpolateDynamics(REAL8Vector *tVec, REAL8Vector *rVec, REAL8Vector *phiVec, REAL8Vector *prVec, REAL8Vector *pphiVec, REAL8Vector *values, REAL8 closestTime)
static int XLALSpinAlignedHiSRStopCondition(double UNUSED t, const double UNUSED values[], double dvalues[], void UNUSED *funcParams)
static int XLALSpinAlignedHiSRStopConditionV4(double UNUSED t, const double UNUSED values[], double dvalues[], void UNUSED *funcParams)
static INT4 XLALSetup_EOB__std_mode_array_structure(LALValue *ModeArray, UINT4 SpinAlignedEOBversion)
ModeArray is a structure which allows to select the modes to include in the waveform.
static int XLALEOBSpinAlignedStopCondition(double UNUSED t, const double values[], double dvalues[], void *funcParams)
Stopping condition for the regular resolution EOB orbital evolution – stop when reaching max orbital ...
static INT4 XLALCheck_EOB_mode_array_structure(LALValue *ModeArray, UINT4 SpinAlignedEOBversion)
ModeArray is a structure which allows to select the modes to include in the waveform.
static UNUSED int SEOBNRv2OptimizedInterpolatorOnlyAmpPhase(REAL8Array *yin, REAL8 tinit, REAL8 deltat, UINT4 num_input_times, REAL8Array **yout)
This function applies the same routines as SEOBNRv2OptimizedInterpolatorNoAmpPhase() above to interpo...
static UNUSED int SEOBNRv2OptimizedInterpolatorNoAmpPhase(REAL8Array *yin, REAL8 tinit, REAL8 deltat, UINT4 num_input_times, REAL8Array **yout)
This function is largely based on/copied from XLALAdaptiveRungeKutta4(), which exists inside the lal/...
static int XLALSpinAlignedHcapDerivative(double t, const REAL8 values[], REAL8 dvalues[], void *funcParams)
static int XLALSpinAlignedHcapDerivativeOptimized(double t, const REAL8 values[], REAL8 dvalues[], void *funcParams)
static int optimized_gsl_spline_eval_e(const gsl_spline *spline, double interptime, gsl_interp_accel *accel, double *output, unsigned int *index_old, double *x_lo_old, double *y_lo_old, double *b_i_old, double *c_i_old, double *d_i_old)
Perform cubic spline interpolation to achieve evenly-sampled data from that input data.
static int XLALSimIMRSpinEOBCalculateSigmaKerr(REAL8Vector *sigmaKerr, REAL8 mass1, REAL8 mass2, REAL8Vector *s1, REAL8Vector *s2)
Function to calculate normalized spin of the deformed-Kerr background in SEOBNRv1.
static int XLALSimIMRSpinEOBCalculateSigmaStar(REAL8Vector *sigmaStar, REAL8 mass1, REAL8 mass2, REAL8Vector *s1, REAL8Vector *s2)
Function to calculate normalized spin of the test particle in SEOBNRv1.
static void GenerateAmpPhaseFromEOMSoln(UINT4 retLen, REAL8 *inputdata, SpinEOBParams *seobParams)
static int XLALSimIMRCalculateSpinEOBHCoeffs(SpinEOBHCoeffs *coeffs, const REAL8 eta, const REAL8 a, const UINT4 SpinAlignedEOBversion)
This function is used to calculate some coefficients which will be used in the spinning EOB Hamiltoni...
static REAL8 XLALSimIMRSpinAlignedEOBCalcOmega(const REAL8 values[], SpinEOBParams *funcParams, REAL8 STEP_SIZE)
Function to calculate the value of omega for the spin-aligned EOB waveform.
static REAL8 XLALSimIMRSpinEOBHamiltonian(const REAL8 eta, REAL8Vector *restrict x, REAL8Vector *restrict p, REAL8Vector *restrict s1Vec, REAL8Vector *restrict s2Vec, REAL8Vector *restrict sigmaKerr, REAL8Vector *restrict sigmaStar, int tortoise, SpinEOBHCoeffs *coeffs)
static const REAL8 STEP_SIZE_CALCOMEGA
UNUSED REAL8 XLALSimIMRSpinEOBHamiltonianOptimized(const REAL8 eta, REAL8Vector *restrict x, REAL8Vector *restrict p, REAL8Vector *restrict s1Vec, REAL8Vector *restrict s2Vec, REAL8Vector *restrict sigmaKerr, REAL8Vector *restrict sigmaStar, INT4 tortoise, SpinEOBHCoeffs *coeffs)
Function to calculate the value of the spinning Hamiltonian for given values of the dynamical variabl...
static REAL8 XLALSimIMRSpinAlignedEOBNonKeplerCoeffOptimized(const REAL8 values[], SpinEOBParams *funcParams)
Function to calculate the non-Keplerian coefficient for the spin-aligned EOB model.
static REAL8 XLALSimIMRSpinAlignedEOBCalcOmegaOptimized(const REAL8 values[], SpinEOBParams *funcParams)
Function to calculate the value of omega for the spin-aligned EOB waveform.
static int XLALSimIMRSpinEOBInitialConditions(REAL8Vector *initConds, const REAL8 mass1, const REAL8 mass2, const REAL8 fMin, const REAL8 inc, const REAL8 spin1[], const REAL8 spin2[], SpinEOBParams *params, INT4 use_optimized_v2)
Main function for calculating the spinning EOB initial conditions, following the quasi-spherical init...
int XLALSimInspiralEOBPostAdiabatic(REAL8Array **dynamics, REAL8 m1, REAL8 m2, REAL8 spin1z, REAL8 spin2z, const REAL8Vector initVals, UINT4 SpinAlignedEOBversion, SpinEOBParams *seobParams, EOBNonQCCoeffs *nqcCoeffs, LALDict *PAParams)
This function generates post-adiabatic inspiral for spin-aligned binary in the SEOB formalism.
static double tau(const double a, const double b, const sysq *system)
Internal function that computes the spin-spin couplings.
void XLALDestroyValue(LALValue *value)
REAL8Array * XLALCreateREAL8ArrayL(UINT4,...)
void XLALDestroyREAL8Array(REAL8Array *)
int XLALAdaptiveRungeKutta4(LALAdaptiveRungeKuttaIntegrator *integrator, void *params, REAL8 *yinit, REAL8 tinit, REAL8 tend, REAL8 deltat, REAL8Array **yout)
void XLALAdaptiveRungeKuttaFree(LALAdaptiveRungeKuttaIntegrator *integrator)
LALAdaptiveRungeKuttaIntegrator * XLALAdaptiveRungeKutta4InitEighthOrderInstead(int dim, int(*dydt)(double t, const double y[], double dydt[], void *params), int(*stop)(double t, const double y[], double dydt[], void *params), double eps_abs, double eps_rel)
int XLALAdaptiveRungeKutta4NoInterpolate(LALAdaptiveRungeKuttaIntegrator *integrator, void *params, REAL8 *yinit, REAL8 tinit, REAL8 tend, REAL8 deltat_or_h0, REAL8 min_deltat_or_h0, REAL8Array **t_and_yout, INT4 EOBversion)
LALAdaptiveRungeKuttaIntegrator * XLALAdaptiveRungeKutta4Init(int dim, int(*dydt)(double t, const double y[], double dydt[], void *params), int(*stop)(double t, const double y[], double dydt[], void *params), double eps_abs, double eps_rel)
INT4 XLALSimIMREOBGenerateQNMFreqV2(COMPLEX16Vector *modefreqs, const REAL8 mass1, const REAL8 mass2, const REAL8 spin1[3], const REAL8 spin2[3], UINT4 l, INT4 m, UINT4 nmodes, Approximant approximant)
These functions generate the quasinormal mode frequencies for a black hole ringdown.
int XLALSimIMRSpinAlignedEOBModes(SphHarmTimeSeries **hlmmode, REAL8Vector **dynamics_out, REAL8Vector **dynamicsHi_out, REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 spin1z, const REAL8 spin2z, UINT4 SpinAlignedEOBversion, const REAL8 lambda2Tidal1, const REAL8 lambda2Tidal2, const REAL8 omega02Tidal1, const REAL8 omega02Tidal2, const REAL8 lambda3Tidal1, const REAL8 lambda3Tidal2, const REAL8 omega03Tidal1, const REAL8 omega03Tidal2, const REAL8 quadparam1, const REAL8 quadparam2, REAL8Vector *nqcCoeffsInput, const INT4 nqcFlag, LALDict *PAParams, LALDict *TGRParams)
This function generates spin-aligned SEOBNRv1,2,2opt,4,4opt,2T,4T,4HM complex modes hlm.
int XLALSimIMRSpinAlignedEOBWaveformAll(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 inc, const REAL8 spin1z, const REAL8 spin2z, UINT4 SpinAlignedEOBversion, const REAL8 lambda2Tidal1, const REAL8 lambda2Tidal2, const REAL8 omega02Tidal1, const REAL8 omega02Tidal2, const REAL8 lambda3Tidal1, const REAL8 lambda3Tidal2, const REAL8 omega03Tidal1, const REAL8 omega03Tidal2, const REAL8 quadparam1, const REAL8 quadparam2, REAL8Vector *nqcCoeffsInput, const INT4 nqcFlag, LALValue *ModeArray, LALDict *TGRParams)
This function takes the modes from the function XLALSimIMRSpinAlignedEOBModes and combine them into h...
int XLALSimIMRSpinAlignedEOBWaveform(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 inc, const REAL8 spin1z, const REAL8 spin2z, UINT4 SpinAlignedEOBversion, LALDict *LALParams)
double XLALSimIMRSpinAlignedEOBPeakFrequency(REAL8 m1SI, REAL8 m2SI, const REAL8 spin1z, const REAL8 spin2z, UINT4 SpinAlignedEOBversion)
This function returns the frequency at which the peak amplitude occurs in SEOBNRv(x)
#define LAL_SIM_L_MAX_MODE_ARRAY
Maximum L spherical harmonic mode that is supported in Mode Array.
Approximant
Enum that specifies the PN approximant to be used in computing the waveform.
@ SEOBNRv2
Spin-aligned EOBNR model v2.
@ SEOBNRv1
Spin-aligned EOBNR model.
@ SEOBNRv4
Spin nonprecessing EOBNR model v4.
int XLALSimAddMode(REAL8TimeSeries *hplus, REAL8TimeSeries *hcross, COMPLEX16TimeSeries *hmode, REAL8 theta, REAL8 phi, int l, int m, int sym)
Multiplies a mode h(l,m) by a spin-2 weighted spherical harmonic to obtain hplus - i hcross,...
SphHarmTimeSeries * XLALSphHarmTimeSeriesAddMode(SphHarmTimeSeries *appended, const COMPLEX16TimeSeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmTimeSeries, or create a new head.
void XLALDestroySphHarmTimeSeries(SphHarmTimeSeries *ts)
Delete list from current pointer to the end of the list.
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series)
COMPLEX16TimeSeries * XLALCreateCOMPLEX16TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalStrainUnit
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_PRINT_WARNING(...)
#define XLAL_TRY(statement, errnum)
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)
The coefficients which are used in calculating the non-quasicircular correction to the EOBNRv2 model.
Structure containing all the parameters needed for the EOB waveform.
FacWaveformCoeffs * hCoeffs
NewtonMultipolePrefixes * prefixes
int(* stop)(double t, const double y[], double dydt[], void *params)
Structure containing all the terms of the Newtonian multipole which are constant over the course of t...
Structure to carry a collection of spherical harmonic modes in COMPLEX16 time series.
struct tagSphHarmTimeSeries * next
next pointer
COMPLEX16TimeSeries * mode
The sequences of sampled data.
Parameters for the spinning EOB model, used in calculating the Hamiltonian.
Parameters for the spinning EOB model.
SpinEOBHCoeffs * seobCoeffs
EOBNonQCCoeffs * nqcCoeffs
Tidal parameters for EOB model of NS: mByM - dimensionless ratio m_{NS}/M lambda2Tidal - dimensionles...