22 #include <gsl/gsl_linalg.h>
23 #include <gsl/gsl_interp.h>
24 #include <gsl/gsl_spline.h>
25 #include <lal/LALStdlib.h>
26 #include <lal/AVFactories.h>
27 #include <lal/SeqFactories.h>
28 #include <lal/Units.h>
29 #include <lal/TimeSeries.h>
30 #include <lal/LALConstants.h>
31 #include <lal/SeqFactories.h>
32 #include <lal/RealFFT.h>
33 #include <lal/SphericalHarmonics.h>
34 #include <lal/LALAdaptiveRungeKuttaIntegrator.h>
35 #include <lal/LALSimInspiral.h>
36 #include <lal/LALSimIMR.h>
37 #include <lal/LALSimSphHarmMode.h>
44 #define LALSIMINSPIRAL_PST4_TEST_ENERGY 1025
45 #define LALSIMINSPIRAL_PST4_TEST_OMEGADOT 1026
46 #define LALSIMINSPIRAL_PST4_TEST_COORDINATE 1027
47 #define LALSIMINSPIRAL_PST4_TEST_OMEGANAN 1028
48 #define LALSIMINSPIRAL_PST4_TEST_FREQBOUND 1029
49 #define LALSIMINSPIRAL_PST4_DERIVATIVE_OMEGANONPOS 1030
50 #define LALSIMINSPIRAL_PST4_TEST_OMEGAMATCH 1031
52 #define LAL_NUM_PST4_VARIABLES 12
54 #define LAL_PST4_ABSOLUTE_TOLERANCE 1.e-12
55 #define LAL_PST4_RELATIVE_TOLERANCE 1.e-12
70 typedef struct tagLALSimInspiralPhenSpinTaylorT4Coeffs {
117 const REAL8 omM = 0.05;
118 const REAL8 omMsz12 = 9.97e-4;
119 const REAL8 omMs1d2 = -2.032e-3;
120 const REAL8 omMssq = 5.629e-3;
121 const REAL8 omMsz1d2 = 8.646e-3;
122 const REAL8 omMszsq = -5.909e-3;
123 const REAL8 omM3s1d2 = 1.801e-3;
124 const REAL8 omM3ssq = -1.4059e-2;
125 const REAL8 omM3sz1d2 = 1.5483e-2;
126 const REAL8 omM3szsq = 8.922e-3;
129 omMsz12 * (LNhS1 + LNhS2) +
131 omMssq * (S1S1 + S2S2) +
132 omMsz1d2 * (LNhS1 * LNhS2) +
133 omMszsq * (LNhS1 * LNhS1 + LNhS2 * LNhS2) +
134 omM3s1d2 * (LNhS1 + LNhS2) * (S1S2) +
135 omM3ssq * (LNhS1 + LNhS2) * (S1S1+S2S2) +
136 omM3sz1d2 * (LNhS1 + LNhS2) * (LNhS1*LNhS2) +
137 omM3szsq * (LNhS1 + LNhS2) * (LNhS1*LNhS1+LNhS2*LNhS2);
142 const double frac0 = 0.840;
143 const double fracsz12 = -2.145e-2;
144 const double fracs1d2 = -4.421e-2;
145 const double fracssq = -2.643e-2;
146 const double fracsz1d2 = -5.876e-2;
147 const double fracszsq = -2.215e-2;
150 fracsz12 * (LNhS1 + LNhS2) +
152 fracssq * (S1S1 + S2S2) +
153 fracsz1d2 * (LNhS1 * LNhS2) +
154 fracszsq * (LNhS1 * LNhS1 + LNhS2 * LNhS2);
178 params->eta = mass1*mass2/(mass1+mass2)/(mass1+mass2);
179 params->m1ByM = mass1 / (mass1+mass2);
180 params->m2ByM = mass2 / (mass1+mass2);
184 params->fEnd = fEnd*unitHz;
185 params->fStart = fStart*unitHz;
187 params->dt =
dt*(fEnd-fStart)/fabs(fEnd-fStart);
201 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
211 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
224 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
251 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
264 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
271 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
277 params->wdotcoeff[1] = phi1;
278 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
284 params->wdotcoeff[0] = 1.;
288 XLALPrintError(
"*** LALSimIMRPhenSpinInspiralRD ERROR: PhenSpin approximant not available at pseudo4PN order\n");
293 XLALPrintError(
"*** LALSimIMRPhenSpinInspiralRD ERROR: Impossible to create waveform with %d order\n",order);
311 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
323 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
335 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
343 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
358 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
364 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
380 const double values[],
385 REAL8 LNhx, LNhy, LNhz;
390 REAL8 dLNhx, dLNhy, dLNhz;
391 REAL8 dS1x, dS1y, dS1z;
392 REAL8 dS2x, dS2y, dS2z;
393 REAL8 energy,energyold;
396 REAL8 S1S2, S1S1, S2S2;
398 REAL8 v, v2, v4, v5, v6, v7;
399 REAL8 tmpx, tmpy, tmpz, cross1x, cross1y, cross1z, cross2x, cross2y, cross2z, LNhxy;
418 energyold = values[11];
425 v7 = omega * omega * v;
429 domega =
params->wdotcoeff[0]
430 + v * (
params->wdotcoeff[1]
431 + v * (
params->wdotcoeff[2]
432 + v * (
params->wdotcoeff[3]
433 + v * (
params->wdotcoeff[4]
434 + v * (
params->wdotcoeff[5]
435 + v * (
params->wdotcoeff[6] +
params->wdotlogcoeff * log(v)
436 + v *
params->wdotcoeff[7]))))));
440 v2 *
params->Ecoeff[6])));
442 domega+= omega*v7* (
params->wdottidal5pn + v2 * (
params->wdottidal6pn ) );
443 energy+= omega*v7* (
params->Etidal5pn + v2 *
params->Etidal6pn);
447 LNhS1 = (LNhx * S1x + LNhy * S1y + LNhz * S1z);
448 LNhS2 = (LNhx * S2x + LNhy * S2y + LNhz * S2z);
451 domega += omega * (
params->wdot3S1O * LNhS1 +
params->wdot3S2O * LNhS2);
453 energy += omega * (
params->E3S1O * LNhS1 +
params->E3S2O * LNhS2);
456 S1S1 = (S1x * S1x + S1y * S1y + S1z * S1z);
457 S2S2 = (S2x * S2x + S2y * S2y + S2z * S2z);
458 S1S2 = (S1x * S2x + S1y * S2y + S1z * S2z);
459 domega += v4 * (
params->wdot4S1S2 * S1S2 +
params->wdot4S1OS2O * LNhS1 * LNhS2);
460 domega += v4 * (
params->wdot4QMS1O * LNhS1*LNhS1 +
params->wdot4QMS2O * LNhS2*LNhS2 +
params->wdot4QMS1 * S1S1 +
params->wdot4QMS2 * S2S2 );
463 energy += v4 * (
params->E4S1S2 * S1S2 +
params->E4S1OS2O * LNhS1 * LNhS2);
464 energy += v4 * (
params->E4QMS1 * S1S1 +
params->E4QMS2 * S2S2 +
params->E4QMS1O * LNhS1 * LNhS1 +
params->E4QMS2O * LNhS2 * LNhS2);
467 domega += v5 * (
params->wdot5S1O * LNhS1 +
params->wdot5S2O * LNhS2);
468 energy += v5 * (
params->E5S1O * LNhS1 +
params->E5S2O * LNhS2);
470 domega += omega*omega * (
params->wdot6S1O * LNhS1 +
params->wdot6S2O * LNhS2);
473 domega *=
params->wdotnewt * v5 * v6;
474 energy *=
params->Enewt * v2;
479 cross1x = (LNhy * S1z - LNhz * S1y);
480 cross1y = (LNhz * S1x - LNhx * S1z);
481 cross1z = (LNhx * S1y - LNhy * S1x);
483 dS1x =
params->S1dot3 * v5 * cross1x;
484 dS1y =
params->S1dot3 * v5 * cross1y;
485 dS1z =
params->S1dot3 * v5 * cross1z;
488 tmpx = S1z * S2y - S1y * S2z;
489 tmpy = S1x * S2z - S1z * S2x;
490 tmpz = S1y * S2x - S1x * S2y;
493 dS1x += v6 * (
params->Sdot4S2*tmpx +
params->Sdot4S2O * LNhS2 * cross1x);
494 dS1y += v6 * (
params->Sdot4S2*tmpy +
params->Sdot4S2O * LNhS2 * cross1y);
495 dS1z += v6 * (
params->Sdot4S2*tmpz +
params->Sdot4S2O * LNhS2 * cross1z);
497 dS1x += v6 * LNhS1 * cross1x *
params->S1dot4QMS1O;
498 dS1y += v6 * LNhS1 * cross1y *
params->S1dot4QMS1O;
499 dS1z += v6 * LNhS1 * cross1z *
params->S1dot4QMS1O;
502 dS1x +=
params->S1dot5 * v7 * cross1x;
503 dS1y +=
params->S1dot5 * v7 * cross1y;
504 dS1z +=
params->S1dot5 * v7 * cross1z;
507 cross2x = (LNhy * S2z - LNhz * S2y);
508 cross2y = (LNhz * S2x - LNhx * S2z);
509 cross2z = (LNhx * S2y - LNhy * S2x);
511 dS2x =
params->S2dot3 * v5 * cross2x;
512 dS2y =
params->S2dot3 * v5 * cross2y;
513 dS2z =
params->S2dot3 * v5 * cross2z;
516 dS2x += v6 * (-
params->Sdot4S2*tmpx +
params->Sdot4S2O * LNhS1 * cross2x);
517 dS2y += v6 * (-
params->Sdot4S2*tmpy +
params->Sdot4S2O * LNhS1 * cross2y);
518 dS2z += v6 * (-
params->Sdot4S2*tmpz +
params->Sdot4S2O * LNhS1 * cross2z);
520 dS2x += v6 * LNhS2 * cross2x *
params->S2dot4QMS2O;
521 dS2y += v6 * LNhS2 * cross2y *
params->S2dot4QMS2O;
522 dS2z += v6 * LNhS2 * cross2z *
params->S2dot4QMS2O;
525 dS2x +=
params->S2dot5 * v7 * cross2x;
526 dS2y +=
params->S2dot5 * v7 * cross2y;
527 dS2z +=
params->S2dot5 * v7 * cross2z;
529 dLNhx = -(dS1x + dS2x) * v /
params->eta;
530 dLNhy = -(dS1y + dS2y) * v /
params->eta;
531 dLNhz = -(dS1z + dS2z) * v /
params->eta;
534 LNhxy = LNhx * LNhx + LNhy * LNhy;
537 alphadotcosi = LNhz * (LNhx * dLNhy - LNhy * dLNhx) / LNhxy;
546 dvalues[0] = omega - alphadotcosi;
580 gsl_interp_accel *acc;
599 for (j = 0; j < wave->
length; ++j)
602 y[j] = wave->
data[j];
605 XLAL_CALLGSL( acc = (gsl_interp_accel*) gsl_interp_accel_alloc() );
606 XLAL_CALLGSL( spline = (gsl_spline*) gsl_spline_alloc(gsl_interp_cspline, wave->
length) );
607 if ( !acc || !spline )
609 if ( acc ) gsl_interp_accel_free(acc);
610 if ( spline ) gsl_spline_free(spline);
618 if ( gslStatus != GSL_SUCCESS )
620 gsl_spline_free(spline);
621 gsl_interp_accel_free(acc);
628 for (j = 0; j < wave->
length; ++j)
630 XLAL_CALLGSL(gslStatus = gsl_spline_eval_deriv_e( spline, j, acc, &dy ) );
631 if (gslStatus != GSL_SUCCESS )
633 gsl_spline_free(spline);
634 gsl_interp_accel_free(acc);
643 gsl_spline_free(spline);
644 gsl_interp_accel_free(acc);
655 REAL8 omega = values[1];
656 REAL8 energy = values[11];
657 REAL8 denergy = dvalues[11];
659 if ( (energy > 0.0) || (( denergy*
params->dt/
params->M > - 0.001*energy )&&(energy<0.) ) ) {
660 if (energy>0.)
XLALPrintWarning(
"*** Test: LALSimIMRPSpinInspiral WARNING **: Bounding energy >ve!\n");
665 else if (omega < 0.0) {
669 else if (dvalues[1] < 0.0) {
673 else if (isnan(omega)) {
677 else if (
params->fEnd > 0. &&
params->fStart >
params->fEnd && omega < params->fEnd) {
694 REAL8 omega = values[1];
695 REAL8 energy = values[11];
696 REAL8 denergy = dvalues[11];
698 REAL8 LNhS1=(values[2]*values[5]+values[3]*values[6]+values[4]*values[7])/
params->m1ByM/
params->m1ByM;
699 REAL8 LNhS2=(values[2]*values[8]+values[3]*values[9]+values[4]*values[10])/
params->m2ByM/
params->m2ByM;
700 REAL8 S1sq =(values[5]*values[5]+values[6]*values[6]+values[7]*values[7])/pow(
params->m1ByM,4);
701 REAL8 S2sq =(values[8]*values[8]+values[9]*values[9]+values[10]*values[10])/pow(
params->m2ByM,4);
702 REAL8 S1S2 =(values[5]*values[8]+values[6]*values[9]+values[7]*values[10])/pow(
params->m1ByM*
params->m2ByM,2);
704 REAL8 omegaMatch=
OmMatch(LNhS1,LNhS2,S1sq,S1S2,S2sq)+0.0005;
706 if ( (energy > 0.0) || (( denergy*
params->dt/
params->M > - 0.001*energy )&&(energy<0.) ) ) {
707 if (energy>0.)
XLALPrintWarning(
"*** Test: LALSimIMRPSpinInspiralRD WARNING **: Bounding energy >ve!\n");
712 else if (omega < 0.0) {
716 else if (dvalues[1] < 0.0) {
720 else if (isnan(omega)) {
724 else if (
params->fEnd > 0. &&
params->fStart >
params->fEnd && omega < params->fEnd) {
732 else if (omega>omegaMatch) {
739 typedef struct tagLALSimInspiralInclAngle {
772 REAL8 amp20 = sqrt(1.5);
776 hL2->
data[2+os] = ( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
780 hL2->
data[2+os]+=I*( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
784 hL2->
data[-2+os] = ( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
786 v * dm / 3. * an->
si * ( cos(Psi - 2. *
alpha) * an->
sHi2 + cos(Psi + 2. *
alpha) * an->
cHi2 ) );
788 hL2->
data[-2+os]+=I*( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
792 hL2->
data[1+os] = an->
si * ( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
794 v * dm / 3. * ( -cos(Psi +
alpha) * (an->
ci + an->
cDi)/2. - cos(Psi -
alpha) * an->
sHi2 * (1. + 2. * an->
ci) ) );
796 hL2->
data[1+os]+= an->
si *I*( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
798 v * dm / 3. * (sin(Psi +
alpha) * (an->
ci + an->
cDi)/2. - sin(Psi -
alpha) * an->
sHi2 * (1.+2.*an->
ci) ) );
800 hL2->
data[-1+os] = an->
si * ( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
802 v * dm / 3. * ( -cos(Psi +
alpha) * (an->
ci + an->
cDi)/2. - cos(Psi -
alpha) * an->
sHi2 * (1. + 2. * an->
ci) ) );
804 hL2->
data[-1+os]+= an->
si *I*( 1./( 1. + damp * v2 / 42. * (107. - 55. * eta) ) *
806 v * dm / 3. * ( sin(Psi +
alpha) * (an->
ci + an->
cDi)/2. - sin(Psi -
alpha) * an->
sHi2 * (1. + 2. * an->
ci) ) );
808 hL2->
data[os] = amp20 * ( an->
si2/( 1. + damp *v2/42.*(107.-55.*eta) )*cos(2.*Psi) + I*v*dm/3.*an->
sDi*sin(Psi) );
822 REAL8 amp32 = sqrt(1.5);
823 REAL8 amp31 = sqrt(0.15);
824 REAL8 amp30 = 1. / sqrt(5)/2.;
828 v2 * 4. * an->
si *(1.-3.*eta)* ( -cos(2.*Psi-3.*
alpha)*an->
sHi4 + cos(2.*Psi+3.*
alpha)*an->
cHi4) );
831 v2 * 4. * an->
si *(1.-3.*eta)* ( -sin(2.*Psi-3.*
alpha)*an->
sHi4 -sin(2.*Psi+3.*
alpha)*an->
cHi4) );
834 v2 * 4. * an->
si *(1.-3.*eta)*( -cos(2.*Psi-3.*
alpha)*an->
sHi4 + cos(2.*Psi+3.*
alpha)*an->
cHi4) );
837 v2 * 4. * an->
si * (1.-3.*eta)*( -sin(2.*Psi-3.*
alpha)*an->
sHi4 - sin(2.*Psi+3.*
alpha)*an->
cHi4 ) );
840 v2*(1./3.-eta) * (-8.*an->
cHi4*(3.*an->
ci-2.)*cos(2.*(Psi+
alpha)) + 8.*an->
sHi4*(3.*an->
ci+2.)*cos(2.*(Psi-
alpha)) ) );
843 v2*(1./3.-eta) * ( 8.*an->
cHi4*(3.*an->
ci-2.)*sin(2.*(Psi+
alpha)) + 8.*an->
sHi4*(3.*an->
ci+2.)*sin(2.*(Psi-
alpha)) ) );
846 v2*(1./3.-eta) * ( 8.*an->
cHi4*(3.*an->
ci-2.)*cos(2.*(Psi+
alpha)) - 8.*an->
sHi4*(3.*an->
ci+2.)*cos(2.*(Psi-
alpha)) ) );
849 v2*(1./3.-eta) * (8.*an->
cHi4*(3.*an->
ci-2.)*sin(2.*(Psi+
alpha)) + 8.*an->
sHi4*(3.*an->
ci+2.)*sin(2.*(Psi-
alpha)) ) );
863 hL3->
data[os] = amp30 * I * ( v * dm * ( cos(Psi)*an->
si*(cos(2.*Psi)*(45.*an->
si2)-(25.*an->
cDi-21.) ) ) +
864 v2*(1.-3.*eta) * (80.*an->
si2*an->
cHi*sin(2.*Psi) ) );
880 REAL8 amp43 = - sqrt(2.);
881 REAL8 amp42 = sqrt(7.)/2.;
882 REAL8 amp41 = sqrt(3.5)/4.;
883 REAL8 amp40 = sqrt(17.5)/16.;
917 hL4->
data[os] = amp40 * (1.-3.*eta) * an->
si2 * (8.*an->
si2*cos(4.*Psi) + cos(2.*Psi)*(an->
cDi+5./7.) );
945 REAL8 S1x0,S1y0,S1z0,S2x0,S2y0,S2z0;
957 XLALPrintError(
"XLAL Error - %s: Cannot allocate integrator\n", __func__);
981 XLALPrintError(
"** LALSimIMRPSpinInspiralRD Error **: Adaptive Integrator\n");
991 XLALPrintError(
"** LALSimIMRPSpinInspiralRD ERROR **: integration too short! intReturnCode %d, integration length %d, at least %d required\n",intReturn,intLen,
minIntLen);
1012 if ( !omega || !Phi || !S1x || !S1y || !S1z || !S2x || !S2y || !S2z || !LNhatx || !LNhaty || !LNhatz || !Energy ) {
1021 jdx= (intLen-1)*(-sign+1)/2;
1023 for (idx=0;idx<intLen;idx++) {
1024 (*Phi)->data->data[idx] = yout->
data[intLen+jdx];
1025 (*omega)->data->data[idx] = yout->
data[2*intLen+jdx];
1026 (*LNhatx)->data->data[idx] = yout->
data[3*intLen+jdx];
1027 (*LNhaty)->data->data[idx] = yout->
data[4*intLen+jdx];
1028 (*LNhatz)->data->data[idx] = yout->
data[5*intLen+jdx];
1029 (*S1x)->data->data[idx] = yout->
data[6*intLen+jdx];
1030 (*S1y)->data->data[idx] = yout->
data[7*intLen+jdx];
1031 (*S1z)->data->data[idx] = yout->
data[8*intLen+jdx];
1032 (*S2x)->data->data[idx] = yout->
data[9*intLen+jdx];
1033 (*S2y)->data->data[idx] = yout->
data[10*intLen+jdx];
1034 (*S2z)->data->data[idx] = yout->
data[11*intLen+jdx];
1035 (*Energy)->data->data[idx] = yout->
data[12*intLen+jdx];
1045 angle->
si=sqrt(1.-ciota*ciota);
1046 angle->
ci2=angle->
ci*angle->
ci;
1047 angle->
si2=angle->
si*angle->
si;
1048 angle->
cDi=angle->
ci*angle->
ci-angle->
si*angle->
si;
1049 angle->
sDi=2.*angle->
ci*angle->
si;
1050 angle->
cHi=sqrt((1.+angle->
ci)/2.);
1051 angle->
sHi=sqrt((1.-angle->
ci)/2.);
1052 angle->
cHi2=(1.+angle->
ci)/2.;
1053 angle->
sHi2=(1.-angle->
ci)/2.;
1080 if ((LNhy*LNhy+LNhx*LNhx)==0.) {
1081 REAL8 S1xy=S1x*S1x+S1y*S1y;
1082 REAL8 S2xy=S2x*S2x+S2y*S2y;
1083 if ((S1xy+S2xy)==0.) {
1093 *
alpha=atan2(LNhy,LNhx);
1143 REAL8 rotY[3][3]={{cos(phi),0.,sin(phi)},{0.,1.,0.},{-sin(phi),0.,cos(phi)}};
1147 for (idx=0;idx<3;idx++) {
1148 *
vx+=rotY[0][idx]*tmp[idx];
1149 *
vy+=rotY[1][idx]*tmp[idx];
1150 *
vz+=rotY[2][idx]*tmp[idx];
1155 REAL8 rotZ[3][3]={{cos(phi),-sin(phi),0.},{sin(phi),cos(phi),0.},{0.,0.,1.}};
1158 for (idx=0;idx<3;idx++) {
1159 *
vx+=rotZ[0][idx]*tmp[idx];
1160 *
vy+=rotZ[1][idx]*tmp[idx];
1161 *
vz+=rotZ[2][idx]*tmp[idx];
1169 const REAL8 inclination,
1175 REAL8 omega=yinitIn[1];
1176 REAL8 LNmag = mass1*mass2 / cbrt(omega);
1177 REAL8 Mass = mass1 + mass2;
1186 S1[0] = yinitIn[5] * mass1 * mass1;
1187 S1[1] = yinitIn[6] * mass1 * mass1;
1188 S1[2] = yinitIn[7] * mass1 * mass1;
1189 S2[0] = yinitIn[8] * mass2 * mass2;
1190 S2[1] = yinitIn[9] * mass2 * mass2;
1191 S2[2] = yinitIn[10] * mass2 * mass2;
1193 switch (axisChoice) {
1196 LNh[0] = -(S1[0]+S2[0])/LNmag;
1197 LNh[1] = -(S1[1]+S2[1])/LNmag;
1198 REAL8 LNhxy2 = LNh[0]*LNh[0]+LNh[1]*LNh[1];
1201 LNh[2]=sqrt(1.-sqrt(LNhxy2));
1202 if ( (LNh[2]*LNmag)<(S1[2]+S2[2]) ) {
1203 XLALPrintError(
"** LALSimIMRPSpinInspiralRD error *** for s1 (%12.4e %12.4e %12.4e)\n",S1[0],S1[1],S1[2]);
1204 XLALPrintError(
" s2 (%12.4e %12.4e %12.4e)\n",S2[0],S2[1],S2[2]);
1205 XLALPrintError(
" wrt to J for m: (%12.4e %12.4e) and v= %12.4e\n",mass1,mass2,cbrt(omega));
1206 XLALPrintError(
" it is impossible to determine the sign of LNhz\n");
1211 XLALPrintError(
"** LALSimIMRPSpinInspiralRD error *** unphysical values of s1 (%12.4e %12.4e %12.4e)\n",S1[0],S1[1],S1[2]);
1212 XLALPrintError(
" s2 (%12.4e %12.4e %12.4e)\n",S2[0],S2[1],S2[2]);
1213 XLALPrintError(
" wrt to J for m: (%12.4e %12.4e) and v= %12.4e\n",mass1,mass2,cbrt(omega));
1223 J[2]=S1[2]+S2[2]+LNmag;
1224 N[0]=-sin(inclination);
1226 N[2]=cos(inclination);
1230 Jmag=sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2]);
1232 phiJ=atan2(J[1],J[0]);
1233 thetaJ=acos(J[2]/Jmag);
1238 *phiN=atan2(
N[1],
N[0]);
1240 rotateZ(-phiJ,&J[0],&J[1],&J[2]);
1241 rotateY(-thetaJ,&J[0],&J[1],&J[2]);
1242 printf(
"Check J: %12.4e %12.4e %12.4e\n",J[0],J[1],J[2]);
1243 printf(
"Check Jmag: %12.4e\n",Jmag);
1249 LNh[0] = sin(inclination);
1251 LNh[2] = cos(inclination);
1252 J[0]=S1[0]+S2[0]+LNh[0]*LNmag;
1254 J[2]=S1[2]+S2[2]+LNh[2]*LNmag;
1258 Jmag=sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2]);
1260 phiJ=atan2(J[1],J[0]);
1261 thetaJ=acos(J[2]/Jmag);
1266 *phiN=atan2(
N[1],
N[0]);
1268 rotateZ(-phiJ,&J[0],&J[1],&J[2]);
1269 rotateY(-thetaJ,&J[0],&J[1],&J[2]);
1270 printf(
"Check J: %12.4e %12.4e %12.4e\n",J[0],J[1],J[2]);
1271 printf(
"Check Jmag: %12.4e\n",Jmag);
1276 rotateZ(-phiJ, &S1[0], &S1[1], &S1[2]);
1277 rotateZ(-phiJ, &S2[0], &S2[1], &S2[2]);
1278 rotateZ(-phiJ, &LNh[0],&LNh[1],&LNh[2]);
1279 rotateY(-thetaJ,&S1[0], &S1[1], &S1[2]);
1280 rotateY(-thetaJ,&S2[0], &S2[1], &S2[2]);
1281 rotateY(-thetaJ,&LNh[0],&LNh[1],&LNh[2]);
1284 *yinitOut[0]=yinitIn[0];
1285 *yinitOut[1]=yinitIn[1];
1286 *yinitOut[2]=LNh[0];
1287 *yinitOut[3]=LNh[1];
1288 *yinitOut[4]=LNh[2];
1289 *yinitOut[5]=S1[0]/Mass/Mass;
1290 *yinitOut[6]=S1[1]/Mass/Mass;
1291 *yinitOut[7]=S1[2]/Mass/Mass;
1292 *yinitOut[8]=S2[0]/Mass/Mass;
1293 *yinitOut[9]=S2[1]/Mass/Mass;
1294 *yinitOut[10]=S2[2]/Mass/Mass;
1296 *yinitOut[idx]=yinitIn[idx];
1322 XLALPrintError(
"** LALSimIMRPSpinInspiralRD error *** non >ve value of fMin %12.4e\n",fStart);
1331 REAL8 S2z=yinit[10];
1335 REAL8 S1S1 = S1x*S1x + S1y*S1y + S1z*S1z;
1336 REAL8 S1S2 = S1x*S2x + S1y*S2y + S1z*S2z;
1337 REAL8 S2S2 = S2x*S2x + S2y*S2y + S2z*S2z;
1340 REAL8 omegaMatch =
OmMatch(LNhS1,LNhS2,S1S1,S1S2,S2S2);
1344 if ( initOmega > omegaMatch ) {
1345 if ((S1x==S1y)&&(S1x==0)&&(S2x==S2y)&&(S2y==0.)) {
1346 initOmega = 0.95*omegaMatch;
1348 XLALPrintWarning(
"*** LALSimIMRPSpinInspiralRD WARNING ***: Initial frequency reset from %12.6e to %12.6e Hz, m:(%12.4e,%12.4e)\n",fStart,initOmega/unitHz/
LAL_PI,mass1,mass2);
1351 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR ***: Initial frequency %12.6e Hz too high, as fMatch estimated %12.6e Hz, m:(%12.4e,%12.4e)\n",fStart,omegaMatch/unitHz/
LAL_PI,mass1,mass2);
1358 if(
XLALSimIMRPhenSpinParamsSetup(
params,
deltaT,fStart,fEnd,mass1,mass2,lambda1,lambda2,quadparam1,quadparam2,
XLALSimInspiralWaveformParamsLookupPNSpinOrder(LALparams),
XLALSimInspiralWaveformParamsLookupPNTidalOrder(LALparams),LALparams,phaseO)) {
1374 memcpy(start->
data->
data + origlen -2,
end->data->data,
1375 (
end->data->length)*
sizeof(
REAL8));
1404 UINT4 i, j, k, nmodes = 8;
1407 REAL8 t1, t2, t3, t4, t5, rt;
1409 gsl_vector *hderivs;
1419 t5 = (matchrange->
data[0] - matchrange->
data[1]) *
m;
1429 if ( inspwave1->
length != 2 || inspwave2->
length != 2 ||
1430 modefreqs->
length != nmodes )
1437 XLAL_CALLGSL( coef = (gsl_matrix *) gsl_matrix_alloc(2 * nmodes, 2 * nmodes) );
1438 XLAL_CALLGSL( hderivs = (gsl_vector *) gsl_vector_alloc(2 * nmodes) );
1439 XLAL_CALLGSL(
x = (gsl_vector *) gsl_vector_alloc(2 * nmodes) );
1440 XLAL_CALLGSL(
p = (gsl_permutation *) gsl_permutation_alloc(2 * nmodes) );
1443 if ( !coef || !hderivs || !
x || !
p )
1445 if (coef) gsl_matrix_free(coef);
1446 if (hderivs) gsl_vector_free(hderivs);
1447 if (
x) gsl_vector_free(
x);
1448 if (
p) gsl_permutation_free(
p);
1456 for (
i = 0;
i < nmodes; ++
i)
1458 gsl_matrix_set(coef, 0,
i, 1);
1459 gsl_matrix_set(coef, 1,
i, - cimag(modefreqs->
data[
i]));
1460 gsl_matrix_set(coef, 2,
i, exp(-cimag(modefreqs->
data[
i])*t1) * cos(creal(modefreqs->
data[
i])*t1));
1461 gsl_matrix_set(coef, 3,
i, exp(-cimag(modefreqs->
data[
i])*t2) * cos(creal(modefreqs->
data[
i])*t2));
1462 gsl_matrix_set(coef, 4,
i, exp(-cimag(modefreqs->
data[
i])*t3) * cos(creal(modefreqs->
data[
i])*t3));
1463 gsl_matrix_set(coef, 5,
i, exp(-cimag(modefreqs->
data[
i])*t4) * cos(creal(modefreqs->
data[
i])*t4));
1464 gsl_matrix_set(coef, 6,
i, exp(-cimag(modefreqs->
data[
i])*t5) * cos(creal(modefreqs->
data[
i])*t5));
1465 gsl_matrix_set(coef, 7,
i, exp(-cimag(modefreqs->
data[
i])*t5) *
1466 (-cimag(modefreqs->
data[
i]) * cos(creal(modefreqs->
data[
i])*t5)
1467 -creal(modefreqs->
data[
i]) * sin(creal(modefreqs->
data[
i])*t5) ));
1468 gsl_matrix_set(coef, 8,
i, 0);
1469 gsl_matrix_set(coef, 9,
i, -creal(modefreqs->
data[
i]));
1470 gsl_matrix_set(coef, 10,
i, -exp(-cimag(modefreqs->
data[
i])*t1) * sin(creal(modefreqs->
data[
i])*t1));
1471 gsl_matrix_set(coef, 11,
i, -exp(-cimag(modefreqs->
data[
i])*t2) * sin(creal(modefreqs->
data[
i])*t2));
1472 gsl_matrix_set(coef, 12,
i, -exp(-cimag(modefreqs->
data[
i])*t3) * sin(creal(modefreqs->
data[
i])*t3));
1473 gsl_matrix_set(coef, 13,
i, -exp(-cimag(modefreqs->
data[
i])*t4) * sin(creal(modefreqs->
data[
i])*t4));
1474 gsl_matrix_set(coef, 14,
i, -exp(-cimag(modefreqs->
data[
i])*t5) * sin(creal(modefreqs->
data[
i])*t5));
1475 gsl_matrix_set(coef, 15,
i, -exp(-cimag(modefreqs->
data[
i])*t5) *
1476 ( cimag(modefreqs->
data[
i]) * sin(creal(modefreqs->
data[
i])*t5)
1477 -creal(modefreqs->
data[
i]) * cos(creal(modefreqs->
data[
i])*t5)));
1480 gsl_vector_set(hderivs, 0, inspwave1->
data[5]);
1481 gsl_vector_set(hderivs, 0 + nmodes, inspwave2->
data[5]);
1482 gsl_vector_set(hderivs, 1, inspwave1->
data[11]);
1483 gsl_vector_set(hderivs, 1 + nmodes, inspwave2->
data[11]);
1484 gsl_vector_set(hderivs, 2, inspwave1->
data[4]);
1485 gsl_vector_set(hderivs, 2 + nmodes, inspwave2->
data[4]);
1486 gsl_vector_set(hderivs, 3, inspwave1->
data[3]);
1487 gsl_vector_set(hderivs, 3 + nmodes, inspwave2->
data[3]);
1488 gsl_vector_set(hderivs, 4, inspwave1->
data[2]);
1489 gsl_vector_set(hderivs, 4 + nmodes, inspwave2->
data[2]);
1490 gsl_vector_set(hderivs, 5, inspwave1->
data[1]);
1491 gsl_vector_set(hderivs, 5 + nmodes, inspwave2->
data[1]);
1492 gsl_vector_set(hderivs, 6, inspwave1->
data[0]);
1493 gsl_vector_set(hderivs, 6 + nmodes, inspwave2->
data[0]);
1494 gsl_vector_set(hderivs, 7, inspwave1->
data[6]);
1495 gsl_vector_set(hderivs, 7 + nmodes, inspwave2->
data[6]);
1498 for (
i = 0;
i < nmodes; ++
i)
1500 for (k = 0; k < nmodes; ++k)
1502 gsl_matrix_set(coef,
i, k + nmodes, - gsl_matrix_get(coef,
i + nmodes, k));
1503 gsl_matrix_set(coef,
i + nmodes, k + nmodes, gsl_matrix_get(coef,
i, k));
1508 printf(
"\nRingdown matching matrix:\n");
1509 for (
i = 0;
i < 16; ++
i) {
1510 for (j = 0; j < 16; ++j) {
1511 printf(
"%8.1e ",gsl_matrix_get(coef,
i,j));
1513 printf(
" | %8.1e\n",gsl_vector_get(hderivs,
i));
1519 if ( gslStatus == GSL_SUCCESS )
1521 XLAL_CALLGSL( gslStatus = gsl_linalg_LU_solve(coef,
p, hderivs,
x) );
1523 if ( gslStatus != GSL_SUCCESS )
1525 gsl_matrix_free(coef);
1526 gsl_vector_free(hderivs);
1528 gsl_permutation_free(
p);
1537 gsl_matrix_free(coef);
1538 gsl_vector_free(hderivs);
1540 gsl_permutation_free(
p);
1544 for (
i = 0;
i < nmodes; ++
i)
1546 modeamps->
data[
i] = gsl_vector_get(
x,
i);
1547 modeamps->
data[
i + nmodes] = gsl_vector_get(
x,
i + nmodes);
1551 for (
i = 0;
i < nmodes; ++
i)
1553 printf(
"%d: om %12.4e 1/tau %12.4e A %12.4e B %12.4e \n",
i,creal(modefreqs->
data[
i]),cimag(modefreqs->
data[
i]),modeamps->
data[
i],modeamps->
data[
i + nmodes]);
1558 gsl_matrix_free(coef);
1559 gsl_vector_free(hderivs);
1561 gsl_permutation_free(
p);
1567 FILE *frd=fopen(
"checkrdPS.dat",
"w");
1571 for (jdx = -5; jdx < 0; ++jdx) {
1575 for (
i = 0;
i < nmodes; ++
i) {
1576 a1 += exp(- tj * cimag(modefreqs->
data[
i]))
1577 * ( modeamps->
data[
i] * cos(tj * creal(modefreqs->
data[
i]))
1578 + modeamps->
data[
i + nmodes] * sin(tj * creal(modefreqs->
data[
i])) );
1579 a2 += exp(- tj * cimag(modefreqs->
data[
i]))
1580 * (- modeamps->
data[
i] * sin(tj * creal(modefreqs->
data[
i]))
1581 + modeamps->
data[
i + nmodes] * cos(tj * creal(modefreqs->
data[
i])) );
1583 fprintf(frd,
" %d %12.4e %12.4e %12.4e\n",jdx,matchrange->
data[1]*
m+tj,.631*a1,.631*
a2);
1585 for (j = 0; j < rdwave1->
length; ++j) {
1587 rdwave1->
data[j] = 0;
1588 rdwave2->
data[j] = 0;
1589 for (
i = 0;
i < nmodes; ++
i) {
1590 rdwave1->
data[j] += exp(- tj * cimag(modefreqs->
data[
i]))
1591 * ( modeamps->
data[
i] * cos(tj * creal(modefreqs->
data[
i]))
1592 + modeamps->
data[
i + nmodes] * sin(tj * creal(modefreqs->
data[
i])) );
1593 rdwave2->
data[j] += exp(- tj * cimag(modefreqs->
data[
i]))
1594 * (- modeamps->
data[
i] * sin(tj * creal(modefreqs->
data[
i]))
1595 + modeamps->
data[
i + nmodes] * cos(tj * creal(modefreqs->
data[
i])) );
1597 if (j<20)
fprintf(frd,
" %d %12.4e %12.4e %12.4e\n",j,matchrange->
data[1]*
m+tj,.631*rdwave1->
data[j],.631*rdwave2->
data[j]);
1608 gsl_interp_accel *acc;
1616 XLALPrintError(
"** LALSimIMRPSpinInspiralRD ERROR **: allocation failed in interpolation routine\n");
1620 for (idx = 0; idx < v->
length; idx++)
x[idx] = idx*
dt;
1621 for (idx = 0; idx < vHi->
length; idx++) xHi[idx] = idx*dtHi;
1626 XLAL_CALLGSL( acc = (gsl_interp_accel*) gsl_interp_accel_alloc() );
1627 XLAL_CALLGSL( spline = (gsl_spline*) gsl_spline_alloc(gsl_interp_cspline, v->
length) );
1628 if ( !acc || !spline )
1630 if ( acc ) gsl_interp_accel_free(acc);
1631 if ( spline ) gsl_spline_free(spline);
1638 if ( gslStatus != GSL_SUCCESS )
1640 gsl_spline_free(spline);
1641 gsl_interp_accel_free(acc);
1647 for (idx = 0; idx < vHi->
length; idx++) {
1648 vHi->
data[idx]=gsl_spline_eval(spline, xHi[idx], acc);
1653 gsl_spline_free(spline);
1654 gsl_interp_accel_free(acc);
1695 LALDict *LALparams )
1708 REAL8 *yinitOut=NULL;
1710 yinit[0] = phi_start;
1714 yinit[4] = cos(iota);
1725 INT4 length = ceil(log10(
x)/log10(2.));
1726 lengthH = pow(2, length);
1741 if (f_ref<=f_start) {
1742 if (
XLALSimIMRPhenSpinInitialize(mass1,mass2,lambda1,lambda2,quadparam1,quadparam2,yinit,f_start,-1.,
deltaT,phaseO,&
params,LALparams,
XLALGetApproximantFromString(
"PhenSpinTaylor")))
1747 yinit[idx] = yinitOut[idx];
1748 errcodeInt=
XLALSimInspiralSpinTaylorT4Engine(&omega,&Phi,&LNhatx,&LNhaty,&LNhatz,&S1x,&S1y,&S1z,&S2x,&S2y,&S2z,&Energy,yinit,lengthH,
PhenSpinTaylor,&
params);
1752 REAL8TimeSeries *Phi1,*omega1,*LNhatx1,*LNhaty1,*LNhatz1,*S1x1,*S1y1,*S1z1,*S2x1,*S2y1,*S2z1,*Energy1;
1753 if (
XLALSimIMRPhenSpinInitialize(mass1,mass2,lambda1,lambda2,quadparam1,quadparam2,yinit,f_ref,f_start,
deltaT,phaseO,&
params,LALparams,
XLALGetApproximantFromString(
"PhenSpinTaylor")))
1758 yinit[idx] = yinitOut[idx];
1765 errcodeInt=
XLALSimInspiralSpinTaylorT4Engine(&omega1,&Phi1,&LNhatx1,&LNhaty1,&LNhatz1,&S1x1,&S1y1,&S1z1,&S2x1,&S2y1,&S2z1,&Energy1,yinit,lengthH,
PhenSpinTaylor,&
params);
1770 XLALPrintError(
"** LALSimIMRPSpinInspiralRD WARNING **: integration terminated with code %d.\n",errcode);
1771 XLALPrintError(
" 1025: Energy increases\n 1026: Omegadot -ve\n 1028: Omega NAN\n 1029: Freqbound\n 1030: Omega -ve\n");
1772 XLALPrintError(
" Waveform parameters were m1 = %14.6e, m2 = %14.6e, inc = %10.6f, fref %10.4f Hz\n", m1, m2, iota, f_ref);
1777 yinit[0] = Phi1->
data->
data[intLen1-1];
1778 yinit[1] = omega1->
data->
data[intLen1-1];
1779 yinit[2] = LNhatx1->
data->
data[intLen1-1];
1780 yinit[3] = LNhaty1->
data->
data[intLen1-1];
1781 yinit[4] = LNhatz1->
data->
data[intLen1-1];
1782 yinit[5] = S1x1->
data->
data[intLen1-1];
1783 yinit[6] = S1y1->
data->
data[intLen1-1];
1784 yinit[7] = S1z1->
data->
data[intLen1-1];
1785 yinit[8] = S2x1->
data->
data[intLen1-1];
1786 yinit[9] = S2y1->
data->
data[intLen1-1];
1787 yinit[10]= S2z1->
data->
data[intLen1-1];
1788 yinit[11]= Energy1->
data->
data[intLen1-1];
1790 REAL8TimeSeries *omega2,*Phi2,*LNhatx2,*LNhaty2,*LNhatz2,*S1x2,*S1y2,*S1z2,*S2x2,*S2y2,*S2z2,*Energy2;
1794 errcodeInt=
XLALSimInspiralSpinTaylorT4Engine(&omega2,&Phi2,&LNhatx2,&LNhaty2,&LNhatz2,&S1x2,&S1y2,&S1z2,&S2x2,&S2y2,&S2z2,&Energy2,yinit,lengthH,
PhenSpinTaylor,&
params);
1811 for (idx=0;idx<intLen;idx++) Phi->
data->
data[idx]-=phiRef;
1817 XLALPrintWarning(
"** LALSimIMRPSpinInspiralRD WARNING **: integration terminated with code %d.\n",errcode);
1818 XLALPrintWarning(
" Waveform parameters were m1 = %14.6e, m2 = %14.6e, inc = %10.6f,\n", m1, m2, iota);
1837 for (idx=0;idx<(int)hPtmp->
data->
length;idx++) {
1846 REAL8 amp33ini = -amp22ini * sqrt(5./42.)/4.;
1847 REAL8 amp44ini = amp22ini * sqrt(5./7.) * 2./9.;
1849 REAL8 eta=mass1*mass2/(mass1+mass2)/(mass1+mass2);
1850 REAL8 dm=(mass1-mass2)/(mass1+mass2);
1852 for (idx=0;idx<intLen;idx++) {
1856 Psi=Phi->
data->
data[idx] -2.*om*(1.-eta*v2)*log(om);
1861 for (kdx=0;kdx<5;kdx++) hL2->
data->
data[5*idx+kdx]=hL2tmp->
data[kdx]*amp22ini*v2;
1863 for (kdx=0;kdx<7;kdx++) hL3->
data->
data[7*idx+kdx]=hL3tmp->
data[kdx]*amp33ini*v2;
1865 for (kdx=0;kdx<9;kdx++) hL4->
data->
data[9*idx+kdx]=hL4tmp->
data[kdx]*amp44ini*v2*v2;
1886 if ( ( modesChoice & LAL_SIM_INSPIRAL_MODES_CHOICE_RESTRICTED) == LAL_SIM_INSPIRAL_MODES_CHOICE_RESTRICTED ) {
1888 for (
m=-
l;
m<=
l;
m++) {
1896 for (
m=-
l;
m<=
l;
m++) {
1897 for (idx=0;idx<intLen;idx++)
1905 for (
m=-
l;
m<=
l;
m++) {
1906 for (idx=0;idx<intLen;idx++)
1915 if ((*hPlus) && (*hCross)) {
1916 if ((*hPlus)->data->length!=(*hCross)->data->length) {
1917 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR: h+ and hx differ in length: %d vs. %d\n",(*hPlus)->data->length,(*hCross)->data->length);
1921 if ((
int)(*hPlus)->data->length<intLen) {
1922 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR: h+ and hx too short: %d vs. %d\n",(*hPlus)->data->length,intLen);
1935 if(*hPlus == NULL || *hCross == NULL)
1940 for (idx=0;idx<minLen;idx++) {
1941 (*hPlus)->data->data[idx] =hPtmp->
data->
data[idx];
1942 (*hCross)->data->data[idx]=hCtmp->
data->
data[idx];
1944 for (idx=minLen;idx<(int)(*hPlus)->data->length;idx++) {
1945 (*hPlus)->data->data[idx] =0.;
1946 (*hCross)->data->data[idx]=0.;
1972 REAL8 ma1,ma2,a12,a12l;
1981 REAL8 t2=16.*(0.6865-t3/64.-sqrt(3.)/2.);
1985 eta = mass1*mass2/((mass1+mass2)*(mass1+mass2));
1990 if (ma1>0.) cosa1 = s1L/ma1;
1992 if (ma2>0.) cosa2 = s2L/ma2;
1994 if ((ma1>0.)&&(ma2>0.)) {
1995 cosa12 = s1s2/ma1/ma2;
1999 a12 = ma1*ma1 + ma2*ma2*
qq*
qq*
qq*
qq + 2.*ma1*ma2*
qq*
qq*cosa12 ;
2000 a12l = ma1*cosa1 + ma2*cosa2*
qq*
qq ;
2001 ll = 2.*sqrt(3.)+ t2*eta + t3*eta*eta + s4*a12/(1.+
qq*
qq)/(1.+
qq*
qq) + (s5*eta+t0+2.)/(1.+
qq*
qq)*a12l;
2004 *finalMass = 1. + energy;
2007 *finalSpin = sqrt( a12 + 2.*ll*
qq*a12l + ll*ll*
qq*
qq)/(1.+
qq)/(1.+
qq);
2010 if (*finalMass < 0.) {
2011 XLALPrintWarning(
"*** LALSimIMRPSpinInspiralRD ERROR: Estimated final mass <0 : %12.6f\n ",*finalMass);
2016 if ((*finalSpin > 1.)||(*finalSpin < 0.)) {
2017 if ((*finalSpin>=1.)&&(*finalSpin<1.01)) {
2018 XLALPrintWarning(
"*** LALSimIMRPSpinInspiralRD WARNING: Estimated final Spin slightly >1 : %11.3e\n ",*finalSpin);
2019 XLALPrintWarning(
" (m1=%8.3f m2=%8.3f s1sq=%8.3f s2sq=%8.3f s1L=%8.3f s2L=%8.3f s1s2=%8.3f ) final spin set to 1 and code goes on\n",mass1,mass2,s1s1,s2s2,s1L,s2L,s1s2);
2020 *finalSpin = .99999;
2023 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR: Unphysical estimation of final Spin : %11.3e\n ",*finalSpin);
2024 XLALPrintWarning(
" (m1=%8.3f m2=%8.3f s1sq=%8.3f s2sq=%8.3f s1L=%8.3f s2L=%8.3f s1s2=%8.3f )\n",mass1,mass2,s1s1,s2s2,s1L,s2L,s1s2);
2058 LALDict *LALparams )
2061 const double rateHi=16384;
2063 XLALPrintError(
"** LALSimIMRPSpinInspiralRD ERROR **: rate must be smaller than %8.0f Hz, value %8.0f Hz given\n",rateHi,1./
deltaT);
2072 REAL8 S1S1=s1x*s1x+s1y*s1y+s1z*s1z;
2073 REAL8 S2S2=s1x*s1x+s1y*s1y+s1z*s1z;
2076 REAL8 Mass=mass1+mass2;
2080 REAL8 *yinitOut=NULL;
2082 yinit[0] = phi_start;
2086 yinit[4] = cos(iota);
2100 INT4 length = ceil(log10(
x)/log10(2.));
2101 lengthH = pow(2, length);
2104 if (f_ref<=f_start) {
2105 if (
XLALSimIMRPhenSpinInitialize(mass1,mass2,lambda1,lambda2,quadparam1,quadparam2,yinit,f_start,-1.,
deltaT,phaseO,&
params,LALparams,
XLALGetApproximantFromString(
"PhenSpinTaylorRD")))
2110 yinit[idx]=yinitOut[idx];
2111 errcodeInt=
XLALSimInspiralSpinTaylorT4Engine(&omega,&Phi,&LNhatx,&LNhaty,&LNhatz,&S1x,&S1y,&S1z,&S2x,&S2y,&S2z,&Energy,yinit,lengthH,
PhenSpinTaylorRD,&
params);
2117 if (
XLALSimIMRPhenSpinInitialize(mass1,mass2,lambda1,lambda2,quadparam1,quadparam2,yinit,f_ref,f_start,
deltaT,phaseO,&
params,LALparams,
XLALGetApproximantFromString(
"PhenSpinTaylorRD")))
2122 yinit[idx]=yinitOut[idx];
2129 errcode=
XLALSimInspiralSpinTaylorT4Engine(&omega1,&Phi1,&LNhatx1,&LNhaty1,&LNhatz1,&S1x1,&S1y1,&S1z1,&S2x1,&S2y1,&S2z1,&Energy1,yinit,lengthH,
PhenSpinTaylorRD,&
params);
2132 XLALPrintError(
"** LALSimIMRPSpinInspiralRD WARNING **: integration terminated with code %d.\n",errcode);
2133 XLALPrintError(
" 1025: Energy increases\n 1026: Omegadot -ve\n 1027: Freqbound\n 1028: Omega NAN\n 1030: Omega -ve\n 1031: Omega > OmegaMatch\n");
2134 XLALPrintError(
" Waveform parameters were m1 = %14.6e, m2 = %14.6e, inc = %10.6f, fref %10.4f Hz\n", mass1, mass2, iota, f_ref);
2141 yinit[0] = Phi1->
data->
data[intLen1-1];
2142 yinit[1] = omega1->
data->
data[intLen1-1];
2143 yinit[2] = LNhatx1->
data->
data[intLen1-1];
2144 yinit[3] = LNhaty1->
data->
data[intLen1-1];
2145 yinit[4] = LNhatz1->
data->
data[intLen1-1];
2146 yinit[5] = S1x1->
data->
data[intLen1-1];
2147 yinit[6] = S1y1->
data->
data[intLen1-1];
2148 yinit[7] = S1z1->
data->
data[intLen1-1];
2149 yinit[8] = S2x1->
data->
data[intLen1-1];
2150 yinit[9] = S2y1->
data->
data[intLen1-1];
2151 yinit[10]= S2z1->
data->
data[intLen1-1];
2152 yinit[11]= Energy1->
data->
data[intLen1-1];
2159 errcodeInt=
XLALSimInspiralSpinTaylorT4Engine(&omega2,&Phi2,&LNhatx2,&LNhaty2,&LNhatz2,&S1x2,&S1y2,&S1z2,&S2x2,&S2y2,&S2z2,&Energy2,yinit,lengthH,
PhenSpinTaylorRD,&
params);
2175 for (idx=0;idx<(int)intLen;idx++) Phi->
data->
data[idx]-=phiRef;
2181 XLALPrintError(
"** LALSimIMRPSpinInspiralRD WARNING **: integration terminated with code %d.\n",errcode);
2182 XLALPrintError(
" 1025: Energy increases\n 1026: Omegadot -ve\n 1027: Freqbound\n 1028: Omega NAN\n 1030: Omega -ve\n");
2183 XLALPrintError(
" Waveform parameters were m1 = %14.6e, m2 = %14.6e, inc = %10.6f,\n", m1, m2, iota);
2189 double tPeak=0.,tm=0.;
2204 for (idx=0;idx<(int)hPtmp->
data->
length;idx++) {
2213 REAL8 amp33ini = -amp22ini * sqrt(5./42.)/4.;
2214 REAL8 amp44ini = amp22ini * sqrt(5./7.) * 2./9.;
2216 REAL8 eta=m1*m2/(m1+m2)/(m1+m2);
2217 REAL8 dm=(m1-m2)/(m1+m2);
2220 for (idx=0;idx<(int)intLen;idx++) {
2224 Psi=Phi->
data->
data[idx] -2.*om*(1.-eta*v2)*log(om);
2228 for (kdx=0;kdx<5;kdx++) hL2->
data->
data[5*idx+kdx]=hL2tmp->
data[kdx]*amp22ini*v2;
2230 for (kdx=0;kdx<7;kdx++) hL3->
data->
data[7*idx+kdx]=hL3tmp->
data[kdx]*amp33ini*v2;
2232 for (kdx=0;kdx<9;kdx++) hL4->
data->
data[9*idx+kdx]=hL4tmp->
data[kdx]*amp44ini*v2*v2;
2236 REAL8 LNhS1,LNhS2,S1S2,omegaMatch;
2242 const double dtHi=1./rateHi;
2243 INT4 stkLength,stkLenHi;
2277 omegaMatch=
OmMatch(LNhS1,LNhS2,S1S1,S1S2,S2S2);
2278 }
while ((idx>0)&&(omega->
data->
data[abs(idx)]>omegaMatch));
2280 XLALPrintError(
" *** XLALSimIMRPSpinInspiralRD ERROR ***: impossible to attach phen part\n");
2297 for (jdx=0; jdx < ( ( (int)omega->
data->
length ) - iMatch); jdx++) {
2328 stkLenHi=((int) (
deltaT/dtHi))*(stkLength-1)+1;
2373 LNhS1=(LNhxHi->
data[idx]*S1xHi->
data[idx]+LNhyHi->
data[idx]*S1yHi->
data[idx]+LNhzHi->
data[idx]*S1zHi->
data[idx])/m1Msq;
2374 LNhS2=(LNhxHi->
data[idx]*S2xHi->
data[idx]+LNhyHi->
data[idx]*S2yHi->
data[idx]+LNhzHi->
data[idx]*S2zHi->
data[idx])/m2Msq;
2375 S1S2=(S1xHi->
data[idx]*S2xHi->
data[idx]+S1yHi->
data[idx]*S2yHi->
data[idx]+S1zHi->
data[idx]*S2zHi->
data[idx])/m1Msq/m2Msq;
2376 omegaMatch=
OmMatch(LNhS1,LNhS2,S1S1,S1S2,S2S2);
2377 if ((omegaMatch>omegaHi->
data[idx])&&(omegaHi->
data[idx]<0.1)) {
2378 if (omegaHi->
data[idx-1]<omegaHi->
data[idx]) iMatchUp=idx;
2383 }
while ((idx>0)&&(iMatchUp==0));
2396 if ( (errcode != 0) || (domegaHi->
data[iMatchUp]<0.) ) {
2397 XLALPrintError(
"**** LALSimIMRPhenSpinInspiralRD ERROR ****: error generating derivatives");
2406 for (idx=0;idx<stkLenHi;idx++) {
2407 LNhxy = LNhxHi->
data[idx] * LNhxHi->
data[idx] + LNhyHi->
data[idx] * LNhyHi->
data[idx];
2409 dalphaHi->
data[idx] = (LNhxHi->
data[idx] * dLNhyHi->
data[idx] - LNhyHi->
data[idx] * dLNhxHi->
data[idx]) / LNhxy;
2411 dalphaHi->
data[idx] = 0.;
2422 REAL8 dom = omegaHi->
data[iMatchUp] - omegaHi->
data[iMatchUp-fac];
2423 REAL8 tAs = (t0 * domegaHi->
data[iMatchUp] - tm1 * dom/
dt)/ (domegaHi->
data[iMatchUp] - dom/
dt);
2424 REAL8 om1 = dom * (tAs -t0)*(tAs-tm1)/
dt/tAs;
2425 REAL8 om0 = omegaHi->
data[iMatchUp] - om1 / (1. - t0 / tAs);
2427 REAL8 dalpha1 = (dalphaHi->
data[iMatchUp]-dalphaHi->
data[iMatchUp-fac]) * (tAs - t0) * (tAs - tm1)/
dt/tAs;
2428 REAL8 dalpha0 = dalphaHi->
data[iMatchUp] - dalpha1 / (1. - t0 / tAs);
2430 while ((tm+
deltaT)<=t0) {
2435 if ((tAs < t0) || (om1 < 0.)) {
2436 XLALPrintError(
"**** LALSimIMRPhenSpinInspiralRD ERROR ****: Could not attach phen part for:\n");
2438 XLALPrintError(
" m1 = %14.6e, m2 = %14.6e, inc = %10.6f,\n", mass1, mass2, iota);
2446 REAL8 alpha0,energy;
2449 om = omegaHi->
data[iMatchUp];
2450 Psi = PhiHi->
data[iMatchUp];
2451 Psi0 = Psi + tAs * (om1/Mtime -dalpha1*trigAngle.
ci) * log(1. - t0 / tAs);
2453 alpha0 =
alpha + tAs * dalpha1 * log(1. - t0 / tAs);
2454 energy = EnergyHi->
data[iMatchUp];
2475 REAL8 finalMass,finalSpin;
2482 XLALPrintError(
"**** LALSimIMRPhenSpinInspiralRD ERROR ****: impossible to generate RingDown frequency\n");
2483 XLALPrintError(
" m (%11.4e %11.4e) f0 %11.4e\n",mass1, mass2, f_start);
2491 REAL8 frOmRD =
fracRD(LNhS1,LNhS2,S1S1,S1S2,S2S2)*omegaRD;
2494 INT4 upcntP=0,upcnt=0;
2498 for (idx=0;idx<up;idx++) {
2500 om = om1 / (1. - tm / tAs) + om0;
2501 if ((om>=frOmRD)&&(upcntP==0)) {
2504 Psi = Psi0 + (- tAs * (om1/Mtime-dalpha1*trigAngle.
ci) * log(1. - tm / tAs) + (om0/Mtime-dalpha0*trigAngle.
ci) * (tm - t0) ) - 2.*om*(1.-eta*pow(om,2./3.))*log(om);
2505 alpha = alpha0 + ( dalpha0 * (tm - t0) - dalpha1 * tAs * log(1. - tm / tAs) );
2511 for (kdx=0;kdx<5;kdx++) hL2->
data->
data[5*count+kdx]=hL2tmp->
data[kdx]*amp22ini*v2;
2513 for (kdx=0;kdx<7;kdx++) hL3->
data->
data[7*count+kdx]=hL3tmp->
data[kdx]*amp33ini*v2;
2515 for (kdx=0;kdx<9;kdx++) hL4->
data->
data[9*count+kdx]=hL4tmp->
data[kdx]*amp44ini*v2*v2;
2516 }
while ( (om < frOmRD) && (tm < tAs) );
2517 tPeak=cntI*
deltaT+upcntP*dtHi;
2523 static const INT4 nPtsComb=6;
2524 if (upcntP<nPtsComb) {
2525 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR: impossible to attach RD");
2544 matchrange->
data[0]=tPeak/Mtime-12.;
2545 matchrange->
data[1]=tPeak/Mtime;
2546 double dtMat=(matchrange->
data[1]-matchrange->
data[0])*Mtime/(nPtsComb-1);
2549 for (idx=nPtsComb+1;idx>=0;idx--) {
2550 tmArray->
data[idx]=tm;
2551 om = om1 / (1. - tm / tAs) + om0;
2552 PsiMat->
data[idx] = Psi0 + (- tAs * (om1/Mtime-dalpha1*trigAngle.
ci) * log(1. - tm / tAs) + (om0/Mtime-dalpha0*trigAngle.
ci) * (tm - t0) ) - 2.*om*(1.-eta*pow(om,2./3.))*log(om);
2553 alpMat->
data[idx] = alpha0 + ( dalpha0 * (tm - t0) - dalpha1 * tAs * log(1. - tm / tAs) );
2554 velMat->
data[idx] = cbrt(om);
2559 if ( !waveR || !dwaveR || !waveI || !dwaveI || !inspWaveR || !inspWaveI ) {
2571 if ( ( modesChoice & LAL_SIM_INSPIRAL_MODES_CHOICE_RESTRICTED) == LAL_SIM_INSPIRAL_MODES_CHOICE_RESTRICTED ) {
2577 for (
m=-
l;
m<=
l;
m++) {
2578 for (idx=0;idx<nPtsComb+2;idx++) {
2580 waveR->
data[idx]=creal(hL2tmp->
data[
m+
l])*amp22ini*pow(velMat->
data[idx],2);
2581 waveI->
data[idx]=cimag(hL2tmp->
data[
m+
l])*amp22ini*pow(velMat->
data[idx],2);
2586 for (idx=0;idx<nPtsComb;idx++) {
2587 inspWaveR->
data[idx] =waveR->
data[idx+1];
2588 inspWaveR->
data[idx+ nPtsComb] =dwaveR->
data[idx+1];
2589 inspWaveI->
data[idx] =waveI->
data[idx+1];
2590 inspWaveI->
data[idx+ nPtsComb] =dwaveI->
data[idx+1];
2593 FILE *out=fopen(
"checkiwPS.dat",
"w");
2594 for (idx=0;idx<(int)tmArray->
length;idx++) {
2595 fprintf(out,
" %d %12.4e %12.4e %12.4e\n",idx,tmArray->
data[idx],.631*waveR->
data[idx],.631*waveI->
data[idx]);
2603 for (idx=0;idx<=count;idx++) {
2606 for (idx=count; idx<count+nRDWave-1;idx++) {
2607 hLMtmp->
data->
data[idx]=rdwave1l2->
data[idx-count+1]+I*rdwave2l2->
data[idx-count+1];
2619 printf(
"Aggiunto modo l=3\n");
2623 for (
m=-
l;
m<=
l;
m++) {
2624 for (idx=0;idx<nPtsComb+2;idx++) {
2626 waveR->
data[idx]=creal(hL3tmp->
data[
m+
l])*amp33ini*velMat->
data[idx]*velMat->
data[idx];
2627 waveI->
data[idx]=cimag(hL3tmp->
data[
m+
l])*amp33ini*velMat->
data[idx]*velMat->
data[idx];
2631 for (idx=0;idx<nPtsComb;idx++) {
2632 inspWaveR->
data[idx] = waveR->
data[idx+1];
2633 inspWaveR->
data[idx+ nPtsComb] = dwaveR->
data[idx+1];
2634 inspWaveI->
data[idx] = waveI->
data[idx+1];
2635 inspWaveI->
data[idx+ nPtsComb] = dwaveI->
data[idx+1];
2639 for (idx=intLen;idx<count;idx++) hLMtmp->
data->
data[idx]=hL3->
data->
data[7*idx+(
l+
m)];
2640 for (idx=count;idx<nRDWave;idx++) hLMtmp->
data->
data[idx]=rdwave1l3->
data[idx-count]+I*rdwave2l3->
data[idx-count];
2650 printf(
"Aggiunto modo l=4\n");
2654 for (
m=-
l;
m<=
l;
m++) {
2655 for (idx=0;idx<nPtsComb+2;idx++) {
2656 kdx=upcnt+idx-nPtsComb-1;
2658 waveR->
data[idx]=creal(hL4tmp->
data[
m+
l])*amp44ini*pow(velMat->
data[idx],4);
2659 waveI->
data[idx]=cimag(hL4tmp->
data[
m+
l])*amp44ini*pow(velMat->
data[idx],4);
2663 for (idx=0;idx<nPtsComb;idx++) {
2664 inspWaveR->
data[idx] = waveR->
data[idx+1];
2665 inspWaveR->
data[idx+ nPtsComb] = dwaveR->
data[idx+1];
2666 inspWaveI->
data[idx] = waveI->
data[idx+1];
2667 inspWaveI->
data[idx+ nPtsComb] = dwaveI->
data[idx+1];
2671 inspWaveI,modefreqs,matchrange);
2672 for (idx=intLen;idx<count;idx++) hLMtmp->
data->
data[idx-intLen]=hL4->
data->
data[9*idx+(
l+
m)];
2673 for (idx=0;idx<nRDWave;idx++) hLMtmp->
data->
data[count-intLen+idx]=rdwave1l4->
data[idx]+I*rdwave2l4->
data[idx];
2716 if ((*hPlus) && (*hCross)) {
2717 if ((*hPlus)->data->length!=(*hCross)->data->length) {
2718 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR: h+ and hx differ in length: %d vs. %d\n",(*hPlus)->data->length,(*hCross)->data->length);
2722 if ((
int)(*hPlus)->data->length<count) {
2723 XLALPrintError(
"*** LALSimIMRPSpinInspiralRD ERROR: h+ and hx too short: %d vs. %d\n",(*hPlus)->data->length,count);
2735 while (wfLen<count) wfLen*=2;
2738 if(*hPlus == NULL || *hCross == NULL)
2743 for (idx=0;idx<minLen;idx++) {
2744 (*hPlus)->data->data[idx] =hPtmp->
data->
data[idx];
2745 (*hCross)->data->data[idx]=hCtmp->
data->
data[idx];
2747 for (idx=minLen;idx<(int)(*hPlus)->data->length;idx++) {
2748 (*hPlus)->data->data[idx] =0.;
2749 (*hCross)->data->data[idx]=0.;
static INT4 XLALSpinInspiralDerivatives(UNUSED double t, const double values[], double dvalues[], void *mparams)
#define LAL_PST4_RELATIVE_TOLERANCE
static INT4 XLALSimIMRPhenSpinParamsSetup(LALSimInspiralPhenSpinTaylorT4Coeffs *params, REAL8 dt, REAL8 fStart, REAL8 fEnd, REAL8 mass1, REAL8 mass2, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, int spinO, int tideO, LALDict *LALparams, UINT4 order)
Convenience function to set up XLALSimInspiralSpinTaylotT4Coeffs struct.
static INT4 XLALSimIMRPhenSpinInitialize(REAL8 mass1, REAL8 mass2, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, REAL8 *yinit, REAL8 fStart, REAL8 fEnd, REAL8 deltaT, INT4 phaseO, LALSimInspiralPhenSpinTaylorT4Coeffs *params, LALDict *LALparams, Approximant approx)
PhenSpin Initialization.
#define LALSIMINSPIRAL_PST4_TEST_OMEGAMATCH
static REAL8 dsign(INT4 i)
static INT4 XLALSimInspiralComputeAlpha(LALSimInspiralPhenSpinTaylorT4Coeffs params, REAL8 LNhx, REAL8 LNhy, REAL8 S1x, REAL8 S1y, REAL8 S2x, REAL8 S2y, REAL8 *alpha)
The following lines are necessary in the case L is initially parallel to N so that alpha is undefined...
#define LAL_NUM_PST4_VARIABLES
static INT4 XLALSimInspiralComputeInclAngle(REAL8 ciota, LALSimInspiralInclAngle *angle)
#define LALSIMINSPIRAL_PST4_TEST_OMEGADOT
#define LALSIMINSPIRAL_PST4_TEST_FREQBOUND
static REAL8TimeSeries * appendTSandFree(REAL8TimeSeries *start, REAL8TimeSeries *end)
static REAL8 fracRD(REAL8 LNhS1, REAL8 LNhS2, REAL8 S1S1, REAL8 S1S2, REAL8 S2S2)
static REAL8 OmMatch(REAL8 LNhS1, REAL8 LNhS2, REAL8 S1S1, REAL8 S1S2, REAL8 S2S2)
static INT4 XLALGenerateWaveDerivative(REAL8Vector *dwave, REAL8Vector *wave, REAL8 dt)
static void rotateY(REAL8 phi, REAL8 *vx, REAL8 *vy, REAL8 *vz)
Here we use the following convention: the coordinates of the spin vectors spin1,2 and the inclination...
static INT4 XLALSimSpinInspiralFillL4Modes(COMPLEX16Vector *hL4, UNUSED REAL8 v, REAL8 eta, UNUSED REAL8 dm, REAL8 Psi, REAL8 alpha, LALSimInspiralInclAngle *an)
static INT4 XLALUpSampling(REAL8Vector *vHi, REAL8 dtHi, REAL8Vector *v, REAL8 dt)
#define LAL_PST4_ABSOLUTE_TOLERANCE
#define LALSIMINSPIRAL_PST4_DERIVATIVE_OMEGANONPOS
static INT4 XLALSimIMRPhenSpinTest(UNUSED double t, const double values[], double dvalues[], void *mparams)
static INT4 XLALSimSpinInspiralFillL2Modes(COMPLEX16Vector *hL2, REAL8 v, REAL8 eta, REAL8 dm, REAL8 Psi, REAL8 alpha, LALSimInspiralInclAngle *an)
static void rotateZ(REAL8 phi, REAL8 *vx, REAL8 *vy, REAL8 *vz)
static INT4 XLALSimIMRHybridRingdownWave(REAL8Vector *rdwave1, REAL8Vector *rdwave2, const REAL8 dt, const REAL8 mass1, const REAL8 mass2, REAL8VectorSequence *inspwave1, REAL8VectorSequence *inspwave2, COMPLEX16Vector *modefreqs, REAL8Vector *matchrange)
#define LALSIMINSPIRAL_PST4_TEST_ENERGY
static INT4 XLALSimInspiralSpinTaylorT4Engine(REAL8TimeSeries **omega, REAL8TimeSeries **Phi, REAL8TimeSeries **LNhatx, REAL8TimeSeries **LNhaty, REAL8TimeSeries **LNhatz, REAL8TimeSeries **S1x, REAL8TimeSeries **S1y, REAL8TimeSeries **S1z, REAL8TimeSeries **S2x, REAL8TimeSeries **S2y, REAL8TimeSeries **S2z, REAL8TimeSeries **Energy, const REAL8 yinit[], const INT4 lengthH, const Approximant approx, LALSimInspiralPhenSpinTaylorT4Coeffs *params)
static INT4 XLALSimSpinInspiralTest(UNUSED double t, const double values[], double dvalues[], void *mparams)
static INT4 XLALSimSpinInspiralFillL3Modes(COMPLEX16Vector *hL3, REAL8 v, REAL8 eta, REAL8 dm, REAL8 Psi, REAL8 alpha, LALSimInspiralInclAngle *an)
static INT4 XLALSimIMRPhenSpinInspiralSetAxis(REAL8 **yinitOut, REAL8 *iota, REAL8 *phiN, REAL8 *yinitIn, const REAL8 inclination, const REAL8 mass1, const REAL8 mass2, LALSimInspiralFrameAxis axisChoice)
#define LALSIMINSPIRAL_PST4_TEST_OMEGANAN
int XLALGetApproximantFromString(const char *waveform)
REAL8 XLALSimInspiralTaylorLength(REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, int O)
static const REAL8 UNUSED XLALSimInspiralSpinDot_4PNS2OCoeffAvg
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_7PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_10PNTidalCoeff(REAL8 mByM)
static const REAL8 UNUSED XLALSimInspiralSpinDot_4PNS2CoeffAvg
static REAL8 UNUSED XLALSimInspiralPNEnergy_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_0PNCoeff(REAL8 eta)
Computes the PN Coefficients for using in the TaylorT4 frequency equation.
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralSpinDot_4PNQMSOCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNS1S2CoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_0PNCoeff(REAL8 eta)
Computes the PN Coefficients for using in the PN energy equation.
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1OS2OCoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNQMS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_3PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_10PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNLogCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1S2CoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNQMS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_12PNTidalCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralSpinDot_3PNCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNS1OS2OCoeffAvg(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNQMS1OS1OCoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNQMS1S1CoeffAvg(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralSpinDot_5PNCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_5PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_3PNCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_6PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_5PNSOCoeff(REAL8 mByM)
static REAL8 UNUSED XLALSimInspiralTaylorT4wdot_4PNS1S1CoeffAvg(REAL8 mByM)
static int UNUSED XLALSimIMRPhenSpinGenerateQNMFreq(COMPLEX16Vector *modefreqs, UINT4 l, INT4 m, REAL8 finalMass, REAL8 finalSpin, REAL8 totalMass)
#define XLAL_CALLGSL(statement)
void XLALDestroyREAL8Array(REAL8Array *)
REAL8VectorSequence * XLALCreateREAL8VectorSequence(UINT4 length, UINT4 veclen)
void XLALDestroyREAL8VectorSequence(REAL8VectorSequence *vecseq)
void XLALAdaptiveRungeKuttaFree(LALAdaptiveRungeKuttaIntegrator *integrator)
int XLALAdaptiveRungeKutta4Hermite(LALAdaptiveRungeKuttaIntegrator *integrator, void *params, REAL8 *yinit, REAL8 tinit, REAL8 tend_in, REAL8 deltat, REAL8Array **yout)
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 XLALSimIMRPhenSpinInspiralRDGenerator(REAL8TimeSeries **hPlus, REAL8TimeSeries **hCross, REAL8 phi_start, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_start, REAL8 f_ref, REAL8 r, REAL8 iota, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, INT4 phaseO, INT4 UNUSED ampO, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, LALDict *LALparams)
Driver routine for generating PhenSpinRD waveforms.
INT4 XLALSimIMRPhenSpinFinalMassSpin(REAL8 *finalMass, REAL8 *finalSpin, REAL8 mass1, REAL8 mass2, REAL8 s1s1, REAL8 s2s2, REAL8 s1L, REAL8 s2L, REAL8 s1s2, REAL8 energy)
INT4 XLALSimSpinInspiralGenerator(REAL8TimeSeries **hPlus, REAL8TimeSeries **hCross, REAL8 phi_start, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_start, REAL8 f_ref, REAL8 r, REAL8 iota, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, INT4 phaseO, INT4 UNUSED ampO, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, LALDict *LALparams)
Driver routine to compute the PhenSpin Inspiral waveform without ring-down.
LALSimInspiralFrameAxis
Enumerator for choosing the reference frame associated with PSpinInspiralRD waveforms.
Approximant
Enum that specifies the PN approximant to be used in computing the waveform.
@ LAL_SIM_INSPIRAL_MODES_CHOICE_3L
Inlude only l=3 modes.
@ LAL_SIM_INSPIRAL_MODES_CHOICE_4L
Inlude only l=4 modes.
@ LAL_SIM_INSPIRAL_SPIN_ORDER_0PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_25PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_ALL
@ LAL_SIM_INSPIRAL_SPIN_ORDER_2PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_15PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_1PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_05PN
@ LAL_SIM_INSPIRAL_SPIN_ORDER_3PN
@ LAL_SIM_INSPIRAL_FRAME_AXIS_VIEW
Set z-axis along direction of GW propagation (line of sight)
@ LAL_SIM_INSPIRAL_FRAME_AXIS_TOTAL_J
Set z-axis along the initial total angular momentum.
@ LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L
Set z-axis along the initial orbital angular momentum.
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_5PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_6PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_ALL
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_0PN
@ PhenSpinTaylor
Inspiral part of the PhenSpinTaylorRD.
@ PhenSpinTaylorRD
Phenomenological waveforms, interpolating between a T4 spin-inspiral and the ringdown.
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,...
REAL8TimeSeries * XLALResizeREAL8TimeSeries(REAL8TimeSeries *series, int first, size_t length)
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
COMPLEX16TimeSeries * XLALCreateCOMPLEX16TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalDimensionlessUnit
COMPLEX16Vector * XLALCreateCOMPLEX16Vector(UINT4 length)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
void XLALDestroyCOMPLEX16Vector(COMPLEX16Vector *vector)
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)
Utility type and function to compute trigonometric functions from the cosine of an angle.
REAL8 E4QMS2
non-dynamical S2^2 2PN quadrupole-monopole correction
REAL8 fStart
starting GW frequency of integration
REAL8 wdotlogcoeff
coefficient of log term in wdot
REAL8 LNhat4SS
non-dynamical 2PN SS correction
REAL8 M
total mass in seconds
REAL8 wdot4QMS1
non-dynamical S1^2 2PN quadrupole-monopole correction
REAL8 Etidal5pn
leading order tidal correction to energy
REAL8 wdottidal5pn
leading order tidal correction
REAL8 E4QMS1
non-dynamical S1^2 2PN quadrupole-monopole correction
REAL8 Etidal6pn
next to leading order tidal correction to energy
REAL8 E4S1OS2O
non-dynamical 2PN SS correction
REAL8 Enewt
coeffs. of PN corrections to energy
REAL8 eta
symmetric mass ratio
REAL8 E4QMS1O
non-dynamical (S1.L)^2 2PN quadrupole-monopole correction
REAL8 wdot4QMS1O
non-dynamical (S1.L)^2 2PN quadrupole-monopole correction
REAL8 wdot4S1OS2O
non-dynamical 2PN SS correction
REAL8 fEnd
ending GW frequency of integration
REAL8 wdottidal6pn
next to leading order tidal correction
REAL8 wdotnewt
leading order coefficient of wdot =
REAL8 E4QMS2O
non-dynamical (S2.L)^2 2PN quadrupole-monopole correction
REAL8 wdot4S1S2
non-dynamical 2PN SS correction
REAL8 wdot4QMS2
non-dynamical S2^2 2PN quadrupole-monopole correction
REAL8 wdot4QMS2O
non-dynamical (S2.L)^2 2PN quadrupole-monopole correction