LALSimulation  5.4.0.1-fe68b98
LALSimIMRPhenomD_internals.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Michael Puerrer, Sebastian Khan, Frank Ohme, Ofek Birnholtz, Lionel London, Francesco Pannarale
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with with program; see the file COPYING. If not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19 
20 /**
21  * \author Michael Puerrer, Sebastian Khan, Frank Ohme, Ofek Birnholtz, Lionel London, Francesco Pannarale
22  *
23  * \file
24  *
25  * \brief Internal function for IMRPhenomD phenomenological waveform model.
26  * See \ref LALSimIMRPhenom_c for more details.
27  *
28  * Note that the functions defined here in LALSimIMRPhenomD_internals.c / .h
29  * must be used by BOTH LALSimIMRPhenomD.c AND LALSimIMRPhenomP.c.
30  */
31 
32 /*
33 This waveform uses the TaylorF2 coefficients for it's inspiral phase augmented
34 by higher order phenomenological terms tuned to SEOBv2-Hybrid waveforms.
35 Below are lines copied from LALSimInspiralPNCoefficients.c which are the TaylorF2
36 phase coefficients we have used.
37 We document them here in case changes to that file changes the behaviour
38 of this waveform.
39 
40  const REAL8 mtot = m1 + m2;
41  const REAL8 d = (m1 - m2) / (m1 + m2);
42  const REAL8 eta = m1*m2/mtot/mtot;
43  const REAL8 m1M = m1/mtot;
44  const REAL8 m2M = m2/mtot;
45  // Use the spin-orbit variables from arXiv:1303.7412, Eq. 3.9
46  // We write dSigmaL for their (\delta m/m) * \Sigma_\ell
47  // There's a division by mtotal^2 in both the energy and flux terms
48  // We just absorb the division by mtotal^2 into SL and dSigmaL
49 
50  const REAL8 SL = m1M*m1M*chi1L + m2M*m2M*chi2L;
51  const REAL8 dSigmaL = d*(m2M*chi2L - m1M*chi1L);
52 
53  const REAL8 pfaN = 3.L/(128.L * eta);
54  //Non-spin phasing terms - see arXiv:0907.0700, Eq. 3.18
55  pfa->v[0] = 1.L;
56  pfa->v[2] = 5.L*(743.L/84.L + 11.L * eta)/9.L;
57  pfa->v[3] = -16.L*LAL_PI;
58  pfa->v[4] = 5.L*(3058.673L/7.056L + 5429.L/7.L * eta
59  + 617.L * eta*eta)/72.L;
60  pfa->v[5] = 5.L/9.L * (7729.L/84.L - 13.L * eta) * LAL_PI;
61  pfa->vlogv[5] = 5.L/3.L * (7729.L/84.L - 13.L * eta) * LAL_PI;
62  pfa->v[6] = (11583.231236531L/4.694215680L
63  - 640.L/3.L * LAL_PI * LAL_PI - 6848.L/21.L*LAL_GAMMA)
64  + eta * (-15737.765635L/3.048192L
65  + 2255./12. * LAL_PI * LAL_PI)
66  + eta*eta * 76055.L/1728.L
67  - eta*eta*eta * 127825.L/1296.L;
68  pfa->v[6] += (-6848.L/21.L)*log(4.);
69  pfa->vlogv[6] = -6848.L/21.L;
70  pfa->v[7] = LAL_PI * ( 77096675.L/254016.L
71  + 378515.L/1512.L * eta - 74045.L/756.L * eta*eta);
72 
73  // Spin-orbit terms - can be derived from arXiv:1303.7412, Eq. 3.15-16
74  const REAL8 pn_gamma = (554345.L/1134.L + 110.L*eta/9.L)*SL + (13915.L/84.L - 10.L*eta/3.)*dSigmaL;
75  switch( spinO )
76  {
77  case LAL_SIM_INSPIRAL_SPIN_ORDER_ALL:
78  case LAL_SIM_INSPIRAL_SPIN_ORDER_35PN:
79  pfa->v[7] += (-8980424995.L/762048.L + 6586595.L*eta/756.L - 305.L*eta*eta/36.L)*SL - (170978035.L/48384.L - 2876425.L*eta/672.L - 4735.L*eta*eta/144.L) * dSigmaL;
80 */
81 
84 
85 /*
86  *
87  * Internal function implementations
88  *
89  */
90 
91 ////////////////////////////// Miscellaneous functions //////////////////////////////
92 
93 /**
94  * PN reduced spin parameter
95  * See Eq 5.9 in http://arxiv.org/pdf/1107.1267v2.pdf
96  */
97 static double chiPN(double Seta, double eta, double chi1, double chi2)
98 {
99  // Convention m1 >= m2 and chi1 is the spin on m1
100  // The 0.5 factor missing in the definitions of chi_s and chi_a is
101  // recovered in the return expresion
102  double chi_s = (chi1 + chi2);
103  double chi_a = (chi1 - chi2);
104 
105  return 0.5 * (chi_s * (1.0 - eta * 76.0 / 113.0) + Seta * chi_a);
106 }
107 
108 /**
109  * Return the closest higher power of 2
110  */
111 static size_t NextPow2(const size_t n)
112 {
113  // use pow here, not bit-wise shift, as the latter seems to run against an upper cutoff long before SIZE_MAX, at least on some platforms
114  return (size_t) pow(2,ceil(log2(n)));
115 }
116 
117 ///**
118 // * Step function
119 // */
120 //static double StepFunc(const double t, const double t1) {
121 // if (t < t1)
122 // return 0.0;
123 // else
124 // return 1.0;
125 //}
126 
127 /**
128  * Step function in boolean version
129  */
130 static bool StepFunc_boolean(const double t, const double t1) {
131  return (!(t < t1));
132 }
133 
134 //////////////////////// Final spin, final mass, fring, fdamp ////////////////////////
135 
136 // Final Spin and Radiated Energy formulas described in 1508.07250
137 
138 /**
139  * Formula to predict the final spin. Equation 3.6 arXiv:1508.07250
140  * s defined around Equation 3.6.
141  */
142 static double FinalSpin0815_s(double eta, double s) {
143  double eta2 = eta*eta;
144  double eta3 = eta2*eta;
145  double s2 = s*s;
146  double s3 = s2*s;
147 
148 /* FIXME: there are quite a few int's withouth a . in this file */
149 //FP: eta2, eta3 can be avoided
150 return eta*(3.4641016151377544 - 4.399247300629289*eta +
151  9.397292189321194*eta2 - 13.180949901606242*eta3 +
152  s*((1.0/eta - 0.0850917821418767 - 5.837029316602263*eta) +
153  (0.1014665242971878 - 2.0967746996832157*eta)*s +
154  (-1.3546806617824356 + 4.108962025369336*eta)*s2 +
155  (-0.8676969352555539 + 2.064046835273906*eta)*s3));
156 }
157 
158 /**
159  * Wrapper function for FinalSpin0815_s.
160  */
161 static double FinalSpin0815(double eta, double chi1, double chi2) {
162  // Convention m1 >= m2
163  double Seta = sqrt(1.0 - 4.0*eta);
164  double m1 = 0.5 * (1.0 + Seta);
165  double m2 = 0.5 * (1.0 - Seta);
166  double m1s = m1*m1;
167  double m2s = m2*m2;
168  // s defined around Equation 3.6 arXiv:1508.07250
169  double s = (m1s * chi1 + m2s * chi2);
170  return FinalSpin0815_s(eta, s);
171 }
172 
173 /**
174  * fring is the real part of the ringdown frequency
175  * 1508.07250 figure 9
176  */
177 static double fring(double eta, double chi1, double chi2, double finspin) {
178  double return_val;
179 
180  if (finspin > 1.0) XLAL_ERROR(XLAL_EDOM, "PhenomD fring function: final spin > 1.0 not supported\n");
181 
182  gsl_interp_accel *acc = gsl_interp_accel_alloc();
183  gsl_spline *iFring = gsl_spline_alloc(gsl_interp_cspline, QNMData_length);
184  gsl_spline_init(iFring, QNMData_a, QNMData_fring, QNMData_length);
185 
186  return_val = gsl_spline_eval(iFring, finspin, acc) / (1.0 - PhenomInternal_EradRational0815(eta, chi1, chi2));
187 
188  gsl_spline_free(iFring);
189  gsl_interp_accel_free(acc);
190  return return_val;
191 }
192 
193 /**
194  * fdamp is the complex part of the ringdown frequency
195  * 1508.07250 figure 9
196  */
197 static double fdamp(double eta, double chi1, double chi2, double finspin) {
198  double return_val;
199 
200  if (finspin > 1.0) XLAL_ERROR(XLAL_EDOM, "PhenomD fdamp function: final spin > 1.0 not supported\n");
201 
202  gsl_interp_accel *acc = gsl_interp_accel_alloc();
203  gsl_spline *iFdamp = gsl_spline_alloc(gsl_interp_cspline, QNMData_length);
204  gsl_spline_init(iFdamp, QNMData_a, QNMData_fdamp, QNMData_length);
205 
206  return_val = gsl_spline_eval(iFdamp, finspin, acc) / (1.0 - PhenomInternal_EradRational0815(eta, chi1, chi2));
207 
208  gsl_spline_free(iFdamp);
209  gsl_interp_accel_free(acc);
210  return return_val;
211 }
212 
213 static int init_useful_powers(UsefulPowers *p, REAL8 number)
214 {
215  XLAL_CHECK(0 != p, XLAL_EFAULT, "p is NULL");
216  XLAL_CHECK(number >= 0, XLAL_EDOM, "number must be non-negative");
217 
218  // consider changing pow(x,1/6.0) to cbrt(x) and sqrt(x) - might be faster
219  double sixth = pow(number, 1.0 / 6.0);
220  p->third = sixth * sixth;
221  //p->third = cbrt(number);
222  p->two_thirds = p->third * p->third;
223  p->four_thirds = number * p->third;
224  p->five_thirds = p->four_thirds * p->third;
225  p->two = number * number;
226  p->seven_thirds = p->third * p->two;
227  p->eight_thirds = p->two_thirds * p->two;
228  p->inv = 1. / number;
229  double m_sixth = 1.0 / sixth;
230  p->m_seven_sixths = p->inv * m_sixth;
231  p->m_third = m_sixth * m_sixth;
232  p->m_two_thirds = p->m_third * p->m_third;
233  p->m_five_thirds = p->inv * p->m_two_thirds;
234 
235  return XLAL_SUCCESS;
236 }
237 
238 /******************************* Amplitude functions *******************************/
239 
240 /**
241  * amplitude scaling factor defined by eq. 17 in 1508.07253
242  */
243 static double amp0Func(double eta) {
244  return sqrt(2.0/3.0*eta)*PI_M_SIXTH;
245 }
246 
247 ///////////////////////////// Amplitude: Inspiral functions /////////////////////////
248 
249 // Phenom coefficients rho1, ..., rho3 from direct fit
250 // AmpInsDFFitCoeffChiPNFunc[eta, chiPN]
251 
252 /**
253  * rho_1 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
254  */
255 static double rho1_fun(double eta, double eta2, double xi) {
256 
257  return 3931.8979897196696 - 17395.758706812805*eta
258  + (3132.375545898835 + 343965.86092361377*eta - 1.2162565819981997e6*eta2
259  + (-70698.00600428853 + 1.383907177859705e6*eta - 3.9662761890979446e6*eta2)*xi
260  + (-60017.52423652596 + 803515.1181825735*eta - 2.091710365941658e6*eta2)*xi*xi)*xi;
261 }
262 
263 
264 /**
265  * rho_2 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
266  */
267 static double rho2_fun(double eta, double eta2, double xi) {
268 
269  return -40105.47653771657 + 112253.0169706701*eta
270  + (23561.696065836168 - 3.476180699403351e6*eta + 1.137593670849482e7*eta2
271  + (754313.1127166454 - 1.308476044625268e7*eta + 3.6444584853928134e7*eta2)*xi
272  + (596226.612472288 - 7.4277901143564405e6*eta + 1.8928977514040343e7*eta2)*xi*xi)*xi;
273 }
274 
275 /**
276  * rho_3 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
277  */
278 static double rho3_fun(double eta, double eta2, double xi) {
279 
280  return 83208.35471266537 - 191237.7264145924*eta
281  + (-210916.2454782992 + 8.71797508352568e6*eta - 2.6914942420669552e7*eta2
282  + (-1.9889806527362722e6 + 3.0888029960154563e7*eta - 8.390870279256162e7*eta2)*xi
283  + (-1.4535031953446497e6 + 1.7063528990822166e7*eta - 4.2748659731120914e7*eta2)*xi*xi)*xi;
284 }
285 
286 // The Newtonian term in LAL is fine and we should use exactly the same (either hardcoded or call).
287 // We just use the Mathematica expression for convenience.
288 /**
289  * Inspiral amplitude plus rho phenom coefficents. rho coefficients computed
290  * in rho1_fun, rho2_fun, rho3_fun functions.
291  * Amplitude is a re-expansion. See 1508.07253 and Equation 29, 30 and Appendix B arXiv:1508.07253 for details
292  */
293 static double AmpInsAnsatz(double Mf, UsefulPowers * powers_of_Mf, AmpInsPrefactors * prefactors) {
294 
295  return 1 + powers_of_Mf->two_thirds * prefactors->two_thirds
296  + powers_of_Mf->four_thirds * prefactors->four_thirds
297  + powers_of_Mf->five_thirds * prefactors->five_thirds
298  + powers_of_Mf->seven_thirds * prefactors->seven_thirds + powers_of_Mf->eight_thirds * prefactors->eight_thirds
299  + Mf * (prefactors->one + Mf * prefactors->two + powers_of_Mf->two * prefactors->three);
300 }
301 
303 {
304  XLAL_CHECK(0 != p, XLAL_EFAULT, "p is NULL");
305  XLAL_CHECK(0 != prefactors, XLAL_EFAULT, "prefactors is NULL");
306 
307  double eta = p->eta;
308 
309  prefactors->amp0 = amp0Func(eta);
310 
311  double chi1 = p->chi1;
312  double chi2 = p->chi2;
313 
314  double chi12 = p->chi12;
315  double chi22 = p->chi22;
316  double eta2 = p->eta2;
317  double eta3 = p->eta3;
318 
319  double Pi = LAL_PI;
320  double Pi2 = powers_of_pi.two;
321  double Seta = p->Seta;
322  double SetaPlus1 = p->SetaPlus1;
323 
324  prefactors->two_thirds = ((-969 + 1804*eta)*powers_of_pi.two_thirds)/672.;
325  prefactors->one = ((chi1*(81*SetaPlus1 - 44*eta) + chi2*(81 - 81*Seta - 44*eta))*Pi)/48.;
326  prefactors->four_thirds = ( (-27312085.0 - 10287648*chi22 - 10287648*chi12*SetaPlus1 + 10287648*chi22*Seta
327  + 24*(-1975055 + 857304*chi12 - 994896*chi1*chi2 + 857304*chi22)*eta
328  + 35371056*eta2
329  )
330  * powers_of_pi.four_thirds) / 8.128512e6;
331  prefactors->five_thirds = (powers_of_pi.five_thirds * (chi2*(-285197*(-1 + Seta) + 4*(-91902 + 1579*Seta)*eta - 35632*eta2)
332  + chi1*(285197*SetaPlus1 - 4*(91902 + 1579*Seta)*eta - 35632*eta2)
333  + 42840*(-1.0 + 4*eta)*Pi
334  )
335  ) / 32256.;
336  prefactors->two = - (Pi2*(-336*(-3248849057.0 + 2943675504*chi12 - 3339284256*chi1*chi2 + 2943675504*chi22)*eta2
337  - 324322727232*eta3
338  - 7*(-177520268561 + 107414046432*chi22 + 107414046432*chi12*SetaPlus1
339  - 107414046432*chi22*Seta + 11087290368*(chi1 + chi2 + chi1*Seta - chi2*Seta)*Pi
340  )
341  + 12*eta*(-545384828789 - 176491177632*chi1*chi2 + 202603761360*chi22
342  + 77616*chi12*(2610335 + 995766*Seta) - 77287373856*chi22*Seta
343  + 5841690624*(chi1 + chi2)*Pi + 21384760320*Pi2
344  )
345  )
346  )/6.0085960704e10;
347  prefactors->seven_thirds = p->rho1;
348  prefactors->eight_thirds = p->rho2;
349  prefactors->three = p->rho3;
350 
351  return XLAL_SUCCESS;
352 }
353 
354 /**
355  * Take the AmpInsAnsatz expression and compute the first derivative
356  * with respect to frequency to get the expression below.
357  */
358 static double DAmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, IMRPhenomDAmplitudeCoefficients* p) {
359  double eta = p->eta;
360  double chi1 = p->chi1;
361  double chi2 = p->chi2;
362  //double rho1 = p->rho1;
363  //double rho2 = p->rho2;
364  //double rho3 = p->rho3;
365 
366  double chi12 = p->chi12;
367  double chi22 = p->chi22;
368  double eta2 = p->eta2;
369  double eta3 = p->eta3;
370  double Pi = LAL_PI;
371  double Pi2 = powers_of_pi.two;
372  double Seta = p->Seta;
373  double SetaPlus1 = p->SetaPlus1;
374 
375  return ((-969 + 1804*eta)*powers_of_pi.two_thirds)/(1008.*powers_of_Mf->third)
376  + ((chi1*(81*SetaPlus1 - 44*eta) + chi2*(81 - 81*Seta - 44*eta))*Pi)/48.
377  + ((-27312085 - 10287648*chi22 - 10287648*chi12*SetaPlus1
378  + 10287648*chi22*Seta + 24*(-1975055 + 857304*chi12 - 994896*chi1*chi2 + 857304*chi22)*eta
379  + 35371056*eta2)*powers_of_Mf->third*powers_of_pi.four_thirds)/6.096384e6
380  + (5*powers_of_Mf->two_thirds*powers_of_pi.five_thirds*(chi2*(-285197*(-1 + Seta)
381  + 4*(-91902 + 1579*Seta)*eta - 35632*eta2) + chi1*(285197*SetaPlus1
382  - 4*(91902 + 1579*Seta)*eta - 35632*eta2) + 42840*(-1 + 4*eta)*Pi))/96768.
383  - (Mf*Pi2*(-336*(-3248849057.0 + 2943675504*chi12 - 3339284256*chi1*chi2 + 2943675504*chi22)*eta2 - 324322727232*eta3
384  - 7*(-177520268561 + 107414046432*chi22 + 107414046432*chi12*SetaPlus1 - 107414046432*chi22*Seta
385  + 11087290368*(chi1 + chi2 + chi1*Seta - chi2*Seta)*Pi)
386  + 12*eta*(-545384828789.0 - 176491177632*chi1*chi2 + 202603761360*chi22 + 77616*chi12*(2610335 + 995766*Seta)
387  - 77287373856*chi22*Seta + 5841690624*(chi1 + chi2)*Pi + 21384760320*Pi2)))/3.0042980352e10
388  + (7.0/3.0)*powers_of_Mf->four_thirds*p->rho1 + (8.0/3.0)*powers_of_Mf->five_thirds*p->rho2 + 3.*powers_of_Mf->two*p->rho3;
389 }
390 
391 /////////////////////////// Amplitude: Merger-Ringdown functions ///////////////////////
392 
393 // Phenom coefficients gamma1, ..., gamma3
394 // AmpMRDAnsatzFunc[]
395 
396 /**
397  * gamma 1 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
398  */
399 static double gamma1_fun(double eta, double eta2, double xi) {
400 
401  return 0.006927402739328343 + 0.03020474290328911*eta
402  + (0.006308024337706171 - 0.12074130661131138*eta + 0.26271598905781324*eta2
403  + (0.0034151773647198794 - 0.10779338611188374*eta + 0.27098966966891747*eta2)*xi
404  + (0.0007374185938559283 - 0.02749621038376281*eta + 0.0733150789135702*eta2)*xi*xi)*xi;
405 }
406 
407 /**
408  * gamma 2 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
409  */
410 static double gamma2_fun(double eta, double eta2, double xi) {
411 
412  return 1.010344404799477 + 0.0008993122007234548*eta
413  + (0.283949116804459 - 4.049752962958005*eta + 13.207828172665366*eta2
414  + (0.10396278486805426 - 7.025059158961947*eta + 24.784892370130475*eta2)*xi
415  + (0.03093202475605892 - 2.6924023896851663*eta + 9.609374464684983*eta2)*xi*xi)*xi;
416 }
417 
418 /**
419  * gamma 3 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
420  */
421 static double gamma3_fun(double eta, double eta2, double xi) {
422 
423  return 1.3081615607036106 - 0.005537729694807678*eta
424  + (-0.06782917938621007 - 0.6689834970767117*eta + 3.403147966134083*eta2
425  + (-0.05296577374411866 - 0.9923793203111362*eta + 4.820681208409587*eta2)*xi
426  + (-0.006134139870393713 - 0.38429253308696365*eta + 1.7561754421985984*eta2)*xi*xi)*xi;
427 }
428 
429 /**
430  * Ansatz for the merger-ringdown amplitude. Equation 19 arXiv:1508.07253
431  */
432 static double AmpMRDAnsatz(double f, IMRPhenomDAmplitudeCoefficients* p) {
433  double fRD = p->fRD;
434  double fDM = p->fDM;
435  double gamma1 = p->gamma1;
436  double gamma2 = p->gamma2;
437  double gamma3 = p->gamma3;
438  double fDMgamma3 = fDM*gamma3;
439  double fminfRD = f - fRD;
440  return exp( -(fminfRD)*gamma2 / (fDMgamma3) )
441  * (fDMgamma3*gamma1) / (pow_2_of(fminfRD) + pow_2_of(fDMgamma3));
442 }
443 
444 /**
445  * first frequency derivative of AmpMRDAnsatz
446  */
447 static double DAmpMRDAnsatz(double f, IMRPhenomDAmplitudeCoefficients* p) {
448  double fRD = p->fRD;
449  double fDM = p->fDM;
450  double gamma1 = p->gamma1;
451  double gamma2 = p->gamma2;
452  double gamma3 = p->gamma3;
453 
454  double fDMgamma3 = fDM * gamma3;
455  double pow2_fDMgamma3 = pow_2_of(fDMgamma3);
456  double fminfRD = f - fRD;
457  double expfactor = exp(((fminfRD)*gamma2)/(fDMgamma3));
458  double pow2pluspow2 = pow_2_of(fminfRD) + pow2_fDMgamma3;
459 
460  return ((-2*fDM*(fminfRD)*gamma3*gamma1) / pow2pluspow2 -
461  (gamma2*gamma1)) / ( expfactor * (pow2pluspow2)) ;
462 }
463 
464 /**
465  * Equation 20 arXiv:1508.07253 (called f_peak in paper)
466  * analytic location of maximum of AmpMRDAnsatz
467  */
469  double fRD = p->fRD;
470  double fDM = p->fDM;
471  double gamma2 = p->gamma2;
472  double gamma3 = p->gamma3;
473 
474  // NOTE: There's a problem with this expression from the paper becoming imaginary if gamma2>=1
475  // Fix: if gamma2 >= 1 then set the square root term to zero.
476  if (!(gamma2 > 1))
477  return fabs(fRD + (fDM*(-1 + sqrt(1 - pow_2_of(gamma2)))*gamma3)/gamma2);
478  else
479  return fabs(fRD + (-fDM*gamma3)/gamma2);
480 }
481 
482 ///////////////////////////// Amplitude: Intermediate functions ////////////////////////
483 
484 // Phenom coefficients delta0, ..., delta4 determined from collocation method
485 // (constraining 3 values and 2 derivatives)
486 // AmpIntAnsatzFunc[]
487 
488 /**
489  * Ansatz for the intermediate amplitude. Equation 21 arXiv:1508.07253
490  */
491 static double AmpIntAnsatz(double Mf, IMRPhenomDAmplitudeCoefficients* p) {
492  double Mf2 = Mf*Mf;
493  return p->delta0 + Mf*p->delta1 + Mf2*(p->delta2 + Mf*p->delta3 + p->delta4*Mf2);
494 }
495 
496 /**
497  * The function name stands for 'Amplitude Intermediate Collocation Fit Coefficient'
498  * This is the 'v2' value in Table 5 of arXiv:1508.07253
499  */
500 static double AmpIntColFitCoeff(double eta, double eta2, double chi) {
501  double xi = -1.0 + chi;
502 
503  return 0.8149838730507785 + 2.5747553517454658*eta
504  + (1.1610198035496786 - 2.3627771785551537*eta + 6.771038707057573*eta2
505  + (0.7570782938606834 - 2.7256896890432474*eta + 7.1140380397149965*eta2)*xi
506  + (0.1766934149293479 - 0.7978690983168183*eta + 2.1162391502005153*eta2)*xi*xi)*xi;
507 }
508 
509  /**
510  * The following functions (delta{0,1,2,3,4}_fun) were derived
511  * in mathematica according to
512  * the constraints detailed in arXiv:1508.07253,
513  * section 'Region IIa - intermediate'.
514  * These are not given in the paper.
515  * Can be rederived by solving Equation 21 for the constraints
516  * given in Equations 22-26 in arXiv:1508.07253
517  */
519  double f1 = p->f1;
520  double f2 = p->f2;
521  double f3 = p->f3;
522  double v1 = p->v1;
523  double v2 = p->v2;
524  double v3 = p->v3;
525  double d1 = p->d1;
526  double d2 = p->d2;
527 
528  double f12 = d->f12;
529  double f13 = d->f13;
530  double f14 = d->f14;
531  double f15 = d->f15;
532  double f22 = d->f22;
533  double f23 = d->f23;
534  double f24 = d->f24;
535  double f32 = d->f32;
536  double f33 = d->f33;
537  double f34 = d->f34;
538  double f35 = d->f35;
539 
540  return -((d2*f15*f22*f3 - 2*d2*f14*f23*f3 + d2*f13*f24*f3 - d2*f15*f2*f32 + d2*f14*f22*f32
541  - d1*f13*f23*f32 + d2*f13*f23*f32 + d1*f12*f24*f32 - d2*f12*f24*f32 + d2*f14*f2*f33
542  + 2*d1*f13*f22*f33 - 2*d2*f13*f22*f33 - d1*f12*f23*f33 + d2*f12*f23*f33 - d1*f1*f24*f33
543  - d1*f13*f2*f34 - d1*f12*f22*f34 + 2*d1*f1*f23*f34 + d1*f12*f2*f35 - d1*f1*f22*f35
544  + 4*f12*f23*f32*v1 - 3*f1*f24*f32*v1 - 8*f12*f22*f33*v1 + 4*f1*f23*f33*v1 + f24*f33*v1
545  + 4*f12*f2*f34*v1 + f1*f22*f34*v1 - 2*f23*f34*v1 - 2*f1*f2*f35*v1 + f22*f35*v1 - f15*f32*v2
546  + 3*f14*f33*v2 - 3*f13*f34*v2 + f12*f35*v2 - f15*f22*v3 + 2*f14*f23*v3 - f13*f24*v3
547  + 2*f15*f2*f3*v3 - f14*f22*f3*v3 - 4*f13*f23*f3*v3 + 3*f12*f24*f3*v3 - 4*f14*f2*f32*v3
548  + 8*f13*f22*f32*v3 - 4*f12*f23*f32*v3) / (pow_2_of(f1 - f2)*pow_3_of(f1 - f3)*pow_2_of(f3-f2)));
549 }
550 
552  double f1 = p->f1;
553  double f2 = p->f2;
554  double f3 = p->f3;
555  double v1 = p->v1;
556  double v2 = p->v2;
557  double v3 = p->v3;
558  double d1 = p->d1;
559  double d2 = p->d2;
560 
561  double f12 = d->f12;
562  double f13 = d->f13;
563  double f14 = d->f14;
564  double f15 = d->f15;
565  double f22 = d->f22;
566  double f23 = d->f23;
567  double f24 = d->f24;
568  double f32 = d->f32;
569  double f33 = d->f33;
570  double f34 = d->f34;
571  double f35 = d->f35;
572 
573  return -((-(d2*f15*f22) + 2*d2*f14*f23 - d2*f13*f24 - d2*f14*f22*f3 + 2*d1*f13*f23*f3
574  + 2*d2*f13*f23*f3 - 2*d1*f12*f24*f3 - d2*f12*f24*f3 + d2*f15*f32 - 3*d1*f13*f22*f32
575  - d2*f13*f22*f32 + 2*d1*f12*f23*f32 - 2*d2*f12*f23*f32 + d1*f1*f24*f32 + 2*d2*f1*f24*f32
576  - d2*f14*f33 + d1*f12*f22*f33 + 3*d2*f12*f22*f33 - 2*d1*f1*f23*f33 - 2*d2*f1*f23*f33
577  + d1*f24*f33 + d1*f13*f34 + d1*f1*f22*f34 - 2*d1*f23*f34 - d1*f12*f35 + d1*f22*f35
578  - 8*f12*f23*f3*v1 + 6*f1*f24*f3*v1 + 12*f12*f22*f32*v1 - 8*f1*f23*f32*v1 - 4*f12*f34*v1
579  + 2*f1*f35*v1 + 2*f15*f3*v2 - 4*f14*f32*v2 + 4*f12*f34*v2 - 2*f1*f35*v2 - 2*f15*f3*v3
580  + 8*f12*f23*f3*v3 - 6*f1*f24*f3*v3 + 4*f14*f32*v3 - 12*f12*f22*f32*v3 + 8*f1*f23*f32*v3)
581  / (pow_2_of(f1 - f2)*pow_3_of(f1 - f3)*pow_2_of(-f2 + f3)));
582 }
583 
585  double f1 = p->f1;
586  double f2 = p->f2;
587  double f3 = p->f3;
588  double v1 = p->v1;
589  double v2 = p->v2;
590  double v3 = p->v3;
591  double d1 = p->d1;
592  double d2 = p->d2;
593 
594  double f12 = d->f12;
595  double f13 = d->f13;
596  double f14 = d->f14;
597  double f15 = d->f15;
598  double f23 = d->f23;
599  double f24 = d->f24;
600  double f32 = d->f32;
601  double f33 = d->f33;
602  double f34 = d->f34;
603  double f35 = d->f35;
604 
605  return -((d2*f15*f2 - d1*f13*f23 - 3*d2*f13*f23 + d1*f12*f24 + 2*d2*f12*f24 - d2*f15*f3
606  + d2*f14*f2*f3 - d1*f12*f23*f3 + d2*f12*f23*f3 + d1*f1*f24*f3 - d2*f1*f24*f3 - d2*f14*f32
607  + 3*d1*f13*f2*f32 + d2*f13*f2*f32 - d1*f1*f23*f32 + d2*f1*f23*f32 - 2*d1*f24*f32 - d2*f24*f32
608  - 2*d1*f13*f33 + 2*d2*f13*f33 - d1*f12*f2*f33 - 3*d2*f12*f2*f33 + 3*d1*f23*f33 + d2*f23*f33
609  + d1*f12*f34 - d1*f1*f2*f34 + d1*f1*f35 - d1*f2*f35 + 4*f12*f23*v1 - 3*f1*f24*v1 + 4*f1*f23*f3*v1
610  - 3*f24*f3*v1 - 12*f12*f2*f32*v1 + 4*f23*f32*v1 + 8*f12*f33*v1 - f1*f34*v1 - f35*v1 - f15*v2
611  - f14*f3*v2 + 8*f13*f32*v2 - 8*f12*f33*v2 + f1*f34*v2 + f35*v2 + f15*v3 - 4*f12*f23*v3 + 3*f1*f24*v3
612  + f14*f3*v3 - 4*f1*f23*f3*v3 + 3*f24*f3*v3 - 8*f13*f32*v3 + 12*f12*f2*f32*v3 - 4*f23*f32*v3)
613  / (pow_2_of(f1 - f2)*pow_3_of(f1 - f3)*pow_2_of(-f2 + f3)));
614 }
615 
617  double f1 = p->f1;
618  double f2 = p->f2;
619  double f3 = p->f3;
620  double v1 = p->v1;
621  double v2 = p->v2;
622  double v3 = p->v3;
623  double d1 = p->d1;
624  double d2 = p->d2;
625 
626  double f12 = d->f12;
627  double f13 = d->f13;
628  double f14 = d->f14;
629  double f22 = d->f22;
630  double f24 = d->f24;
631  double f32 = d->f32;
632  double f33 = d->f33;
633  double f34 = d->f34;
634 
635  return -((-2*d2*f14*f2 + d1*f13*f22 + 3*d2*f13*f22 - d1*f1*f24 - d2*f1*f24 + 2*d2*f14*f3
636  - 2*d1*f13*f2*f3 - 2*d2*f13*f2*f3 + d1*f12*f22*f3 - d2*f12*f22*f3 + d1*f24*f3 + d2*f24*f3
637  + d1*f13*f32 - d2*f13*f32 - 2*d1*f12*f2*f32 + 2*d2*f12*f2*f32 + d1*f1*f22*f32 - d2*f1*f22*f32
638  + d1*f12*f33 - d2*f12*f33 + 2*d1*f1*f2*f33 + 2*d2*f1*f2*f33 - 3*d1*f22*f33 - d2*f22*f33
639  - 2*d1*f1*f34 + 2*d1*f2*f34 - 4*f12*f22*v1 + 2*f24*v1 + 8*f12*f2*f3*v1 - 4*f1*f22*f3*v1
640  - 4*f12*f32*v1 + 8*f1*f2*f32*v1 - 4*f22*f32*v1 - 4*f1*f33*v1 + 2*f34*v1 + 2*f14*v2
641  - 4*f13*f3*v2 + 4*f1*f33*v2 - 2*f34*v2 - 2*f14*v3 + 4*f12*f22*v3 - 2*f24*v3 + 4*f13*f3*v3
642  - 8*f12*f2*f3*v3 + 4*f1*f22*f3*v3 + 4*f12*f32*v3 - 8*f1*f2*f32*v3 + 4*f22*f32*v3)
643  / (pow_2_of(f1 - f2)*pow_3_of(f1 - f3)*pow_2_of(-f2 + f3)));
644 }
645 
647  double f1 = p->f1;
648  double f2 = p->f2;
649  double f3 = p->f3;
650  double v1 = p->v1;
651  double v2 = p->v2;
652  double v3 = p->v3;
653  double d1 = p->d1;
654  double d2 = p->d2;
655 
656  double f12 = d->f12;
657  double f13 = d->f13;
658  double f22 = d->f22;
659  double f23 = d->f23;
660  double f32 = d->f32;
661  double f33 = d->f33;
662 
663  return -((d2*f13*f2 - d1*f12*f22 - 2*d2*f12*f22 + d1*f1*f23 + d2*f1*f23 - d2*f13*f3 + 2*d1*f12*f2*f3
664  + d2*f12*f2*f3 - d1*f1*f22*f3 + d2*f1*f22*f3 - d1*f23*f3 - d2*f23*f3 - d1*f12*f32 + d2*f12*f32
665  - d1*f1*f2*f32 - 2*d2*f1*f2*f32 + 2*d1*f22*f32 + d2*f22*f32 + d1*f1*f33 - d1*f2*f33 + 3*f1*f22*v1
666  - 2*f23*v1 - 6*f1*f2*f3*v1 + 3*f22*f3*v1 + 3*f1*f32*v1 - f33*v1 - f13*v2 + 3*f12*f3*v2 - 3*f1*f32*v2
667  + f33*v2 + f13*v3 - 3*f1*f22*v3 + 2*f23*v3 - 3*f12*f3*v3 + 6*f1*f2*f3*v3 - 3*f22*f3*v3)
668  / (pow_2_of(f1 - f2)*pow_3_of(f1 - f3)*pow_2_of(-f2 + f3)));
669 }
670 
671 /**
672  * Calculates delta_i's
673  * Method described in arXiv:1508.07253 section 'Region IIa - intermediate'
674  */
676  // Three evenly spaced collocation points in the interval [f1,f3].
677  double f1 = AMP_fJoin_INS;
678  double f3 = p->fmaxCalc;
679  double dfx = 0.5*(f3 - f1);
680  double f2 = f1 + dfx;
681 
682  UsefulPowers powers_of_f1;
683  int status = init_useful_powers(&powers_of_f1, f1);
684  XLAL_CHECK_VOID ( status == XLAL_SUCCESS, XLAL_EFUNC, "Failed to initialize useful powers of f1.");
685 
686  AmpInsPrefactors prefactors;
687  status = init_amp_ins_prefactors(&prefactors, p);
688  XLAL_CHECK_VOID ( status == XLAL_SUCCESS, XLAL_EFUNC, "Failed to initialize amplitude prefactors for inspiral range.");
689 
690 
691  // v1 is inspiral model evaluated at f1
692  // d1 is derivative of inspiral model evaluated at f1
693  double v1 = AmpInsAnsatz(f1, &powers_of_f1, &prefactors);
694  double d1 = DAmpInsAnsatz(f1, &powers_of_f1, p);
695 
696  // v3 is merger-ringdown model evaluated at f3
697  // d2 is derivative of merger-ringdown model evaluated at f3
698  double v3 = AmpMRDAnsatz(f3, p);
699  double d2 = DAmpMRDAnsatz(f3, p);
700 
701  // v2 is the value of the amplitude evaluated at f2
702  // they come from the fit of the collocation points in the intermediate region
703  double v2 = AmpIntColFitCoeff(p->eta, p->eta2, p->chi);
704 
705  p->f1 = f1;
706  p->f2 = f2;
707  p->f3 = f3;
708  p->v1 = v1;
709  p->v2 = v2;
710  p->v3 = v3;
711  p->d1 = d1;
712  p->d2 = d2;
713 
714  // Now compute the delta_i's from the collocation coefficients
715  // Precompute common quantities here and pass along to delta functions.
716  DeltaUtility d;
717  d.f12 = f1*f1;
718  d.f13 = f1*d.f12;
719  d.f14 = f1*d.f13;
720  d.f15 = f1*d.f14;
721  d.f22 = f2*f2;
722  d.f23 = f2*d.f22;
723  d.f24 = f2*d.f23;
724  d.f32 = f3*f3;
725  d.f33 = f3*d.f32;
726  d.f34 = f3*d.f33;
727  d.f35 = f3*d.f34;
728  p->delta0 = delta0_fun(p, &d);
729  p->delta1 = delta1_fun(p, &d);
730  p->delta2 = delta2_fun(p, &d);
731  p->delta3 = delta3_fun(p, &d);
732  p->delta4 = delta4_fun(p, &d);
733 }
734 
735 
736 ///////////////////////////// Amplitude: glueing function ////////////////////////////
737 
738 /**
739  * A struct containing all the parameters that need to be calculated
740  * to compute the phenomenological amplitude
741  */
742 static void ComputeIMRPhenomDAmplitudeCoefficients(IMRPhenomDAmplitudeCoefficients *p, double eta, double chi1, double chi2, double finspin) {
743 
744  p->eta = eta;
745  p->etaInv = 1./eta;
746  p->chi1 = chi1;
747  p->chi2 = chi2;
748  p->chi12 = chi1*chi1;
749  p->chi22 = chi2*chi2;
750  double eta2 = eta*eta;
751  p->eta2 = eta2;
752  p->eta3 = eta*eta2;
753  double Seta = sqrt(1.0 - 4.0*eta);
754  p->Seta = Seta;
755  p->SetaPlus1 = 1.0 + Seta;
756 
757  p->q = 0.5 * (1.0 + Seta - 2.0*eta) * p->etaInv;
758  p->chi = chiPN(Seta, eta, chi1, chi2);
759  double xi = -1.0 + p->chi;
760 
761  p->fRD = fring(eta, chi1, chi2, finspin);
762  p->fDM = fdamp(eta, chi1, chi2, finspin);
763 
764  // Compute gamma_i's, rho_i's first then delta_i's
765  p->gamma1 = gamma1_fun(eta, eta2, xi);
766  p->gamma2 = gamma2_fun(eta, eta2, xi);
767  p->gamma3 = gamma3_fun(eta, eta2, xi);
768 
769  p->fmaxCalc = fmaxCalc(p);
770 
771  p->rho1 = rho1_fun(eta, eta2, xi);
772  p->rho2 = rho2_fun(eta, eta2, xi);
773  p->rho3 = rho3_fun(eta, eta2, xi);
774 
775  // compute delta_i's
777 
778 }
779 
780 // Call ComputeIMRPhenomDAmplitudeCoefficients() first!
781 /**
782  * This function computes the IMR amplitude given phenom coefficients.
783  * Defined in VIII. Full IMR Waveforms arXiv:1508.07253
784  */
785 static double IMRPhenDAmplitude(double f, IMRPhenomDAmplitudeCoefficients *p, UsefulPowers *powers_of_f, AmpInsPrefactors * prefactors) {
786  // Defined in VIII. Full IMR Waveforms arXiv:1508.07253
787  // The inspiral, intermediate and merger-ringdown amplitude parts
788 
789  // Transition frequencies
790  p->fInsJoin = AMP_fJoin_INS;
791  p->fMRDJoin = p->fmaxCalc;
792 
793  double AmpPreFac = prefactors->amp0 * powers_of_f->m_seven_sixths;
794 
795  // split the calculation to just 1 of 3 possible mutually exclusive ranges
796 
797  if (!StepFunc_boolean(f, p->fInsJoin)) // Inspiral range
798  {
799  double AmpIns = AmpPreFac * AmpInsAnsatz(f, powers_of_f, prefactors);
800  return AmpIns;
801  }
802 
803  if (StepFunc_boolean(f, p->fMRDJoin)) // MRD range
804  {
805  double AmpMRD = AmpPreFac * AmpMRDAnsatz(f, p);
806  return AmpMRD;
807  }
808 
809  // Intermediate range
810  double AmpInt = AmpPreFac * AmpIntAnsatz(f, p);
811  return AmpInt;
812 }
813 
814 /********************************* Phase functions *********************************/
815 
816 ////////////////////////////// Phase: Ringdown functions ///////////////////////////
817 
818 // alpha_i i=1,2,3,4,5 are the phenomenological intermediate coefficients depending on eta and chiPN
819 // PhiRingdownAnsatz is the ringdown phasing in terms of the alpha_i coefficients
820 
821 /**
822  * alpha 1 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
823  */
824 static double alpha1Fit(double eta, double eta2, double xi) {
825 
826  return 43.31514709695348 + 638.6332679188081*eta
827  + (-32.85768747216059 + 2415.8938269370315*eta - 5766.875169379177*eta2
828  + (-61.85459307173841 + 2953.967762459948*eta - 8986.29057591497*eta2)*xi
829  + (-21.571435779762044 + 981.2158224673428*eta - 3239.5664895930286*eta2)*xi*xi)*xi;
830 }
831 
832 /**
833  * alpha 2 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
834  */
835 static double alpha2Fit(double eta, double eta2, double xi) {
836 
837  return -0.07020209449091723 - 0.16269798450687084*eta
838  + (-0.1872514685185499 + 1.138313650449945*eta - 2.8334196304430046*eta2
839  + (-0.17137955686840617 + 1.7197549338119527*eta - 4.539717148261272*eta2)*xi
840  + (-0.049983437357548705 + 0.6062072055948309*eta - 1.682769616644546*eta2)*xi*xi)*xi;
841 }
842 
843 /**
844  * alpha 3 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
845  */
846 static double alpha3Fit(double eta, double eta2, double xi) {
847 
848  return 9.5988072383479 - 397.05438595557433*eta
849  + (16.202126189517813 - 1574.8286986717037*eta + 3600.3410843831093*eta2
850  + (27.092429659075467 - 1786.482357315139*eta + 5152.919378666511*eta2)*xi
851  + (11.175710130033895 - 577.7999423177481*eta + 1808.730762932043*eta2)*xi*xi)*xi;
852 }
853 
854 /**
855  * alpha 4 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
856  */
857 static double alpha4Fit(double eta, double eta2, double xi) {
858 
859  return -0.02989487384493607 + 1.4022106448583738*eta
860  + (-0.07356049468633846 + 0.8337006542278661*eta + 0.2240008282397391*eta2
861  + (-0.055202870001177226 + 0.5667186343606578*eta + 0.7186931973380503*eta2)*xi
862  + (-0.015507437354325743 + 0.15750322779277187*eta + 0.21076815715176228*eta2)*xi*xi)*xi;
863 }
864 
865 /**
866  * alpha 5 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
867  */
868 static double alpha5Fit(double eta, double eta2, double xi) {
869 
870  return 0.9974408278363099 - 0.007884449714907203*eta
871  + (-0.059046901195591035 + 1.3958712396764088*eta - 4.516631601676276*eta2
872  + (-0.05585343136869692 + 1.7516580039343603*eta - 5.990208965347804*eta2)*xi
873  + (-0.017945336522161195 + 0.5965097794825992*eta - 2.0608879367971804*eta2)*xi*xi)*xi;
874 }
875 
876 /**
877  * Ansatz for the merger-ringdown phase Equation 14 arXiv:1508.07253
878  * Rholm was added when IMRPhenomHM (high mode) was added.
879  * Rholm = fRD22/fRDlm. For PhenomD (only (l,m)=(2,2)) this is just equal
880  * to 1. and PhenomD is recovered.
881  * Taulm = fDMlm/fDM22. Ratio of ringdown damping times.
882  * Again, when Taulm = 1.0 then PhenomD is recovered.
883  */
884 static double PhiMRDAnsatzInt(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm)
885 {
886  double sqrootf = sqrt(f);
887  double fpow1_5 = f * sqrootf;
888  // check if this is any faster: 2 sqrts instead of one pow(x,0.75)
889  double fpow0_75 = sqrt(fpow1_5); // pow(f,0.75);
890 
891  return -(p->alpha2/f)
892  + (4.0/3.0) * (p->alpha3 * fpow0_75)
893  + p->alpha1 * f
894  + p->alpha4 * Rholm * atan((f - p->alpha5 * p->fRD) / (Rholm * p->fDM * Taulm));
895 }
896 
897 /**
898  * First frequency derivative of PhiMRDAnsatzInt
899  * Rholm was added when IMRPhenomHM (high mode) was added.
900  * Rholm = fRD22/fRDlm. For PhenomD (only (l,m)=(2,2)) this is just equal
901  * to 1. and PhenomD is recovered.
902  * Taulm = fDMlm/fDM22. Ratio of ringdown damping times.
903  * Again, when Taulm = 1.0 then PhenomD is recovered.
904  */
905 static double DPhiMRD(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm) {
906  return ( p->alpha1 + p->alpha2/pow_2_of(f) + p->alpha3/pow(f,0.25)+ p->alpha4/(p->fDM * Taulm * (1 + pow_2_of(f - p->alpha5 * p->fRD)/(pow_2_of(p->fDM * Taulm * Rholm)))) ) * p->etaInv;
907 }
908 
909 ///////////////////////////// Phase: Intermediate functions /////////////////////////////
910 
911 // beta_i i=1,2,3 are the phenomenological intermediate coefficients depending on eta and chiPN
912 // PhiIntAnsatz is the intermediate phasing in terms of the beta_i coefficients
913 
914 
915 // \[Beta]1Fit = PhiIntFitCoeff\[Chi]PNFunc[\[Eta], \[Chi]PN][[1]]
916 
917 /**
918  * beta 1 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
919  */
920 static double beta1Fit(double eta, double eta2, double xi) {
921 
922  return 97.89747327985583 - 42.659730877489224*eta
923  + (153.48421037904913 - 1417.0620760768954*eta + 2752.8614143665027*eta2
924  + (138.7406469558649 - 1433.6585075135881*eta + 2857.7418952430758*eta2)*xi
925  + (41.025109467376126 - 423.680737974639*eta + 850.3594335657173*eta2)*xi*xi)*xi;
926 }
927 
928 /**
929  * beta 2 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
930  */
931 static double beta2Fit(double eta, double eta2, double xi) {
932 
933  return -3.282701958759534 - 9.051384468245866*eta
934  + (-12.415449742258042 + 55.4716447709787*eta - 106.05109938966335*eta2
935  + (-11.953044553690658 + 76.80704618365418*eta - 155.33172948098394*eta2)*xi
936  + (-3.4129261592393263 + 25.572377569952536*eta - 54.408036707740465*eta2)*xi*xi)*xi;
937 }
938 
939 /**
940  * beta 3 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
941  */
942 static double beta3Fit(double eta, double eta2, double xi) {
943 
944  return -0.000025156429818799565 + 0.000019750256942201327*eta
945  + (-0.000018370671469295915 + 0.000021886317041311973*eta + 0.00008250240316860033*eta2
946  + (7.157371250566708e-6 - 0.000055780000112270685*eta + 0.00019142082884072178*eta2)*xi
947  + (5.447166261464217e-6 - 0.00003220610095021982*eta + 0.00007974016714984341*eta2)*xi*xi)*xi;
948 }
949 
950 
951 /**
952  * ansatz for the intermediate phase defined by Equation 16 arXiv:1508.07253
953  */
954 static double PhiIntAnsatz(double Mf, IMRPhenomDPhaseCoefficients *p) {
955  // 1./eta in paper omitted and put in when need in the functions:
956  // ComputeIMRPhenDPhaseConnectionCoefficients
957  // IMRPhenDPhase
958  return p->beta1*Mf - p->beta3/(3.*pow_3_of(Mf)) + p->beta2*log(Mf);
959 }
960 
961 /**
962  * First frequency derivative of PhiIntAnsatz
963  * (this time with 1./eta explicitly factored in)
964  */
965 static double DPhiIntAnsatz(double Mf, IMRPhenomDPhaseCoefficients *p) {
966  return (p->beta1 + p->beta3/pow_4_of(Mf) + p->beta2/Mf) * p->etaInv;
967 }
968 
969 /**
970  * temporary instance of DPhiIntAnsatz used when computing
971  * coefficients to make the phase C(1) continuous between regions.
972  */
973 static double DPhiIntTemp(double ff, IMRPhenomDPhaseCoefficients *p) {
974  double etaInv = p->etaInv;
975  double beta1 = p->beta1;
976  double beta2 = p->beta2;
977  double beta3 = p->beta3;
978  double C2Int = p->C2Int;
979 
980  return C2Int + (beta1 + beta3/pow_4_of(ff) + beta2/ff)*etaInv;
981 }
982 
983 ///////////////////////////// Phase: Inspiral functions /////////////////////////////
984 
985 // sigma_i i=1,2,3,4 are the phenomenological inspiral coefficients depending on eta and chiPN
986 // PhiInsAnsatzInt is a souped up TF2 phasing which depends on the sigma_i coefficients
987 
988 /**
989  * sigma 1 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
990  */
991 static double sigma1Fit(double eta, double eta2, double xi) {
992 
993  return 2096.551999295543 + 1463.7493168261553*eta
994  + (1312.5493286098522 + 18307.330017082117*eta - 43534.1440746107*eta2
995  + (-833.2889543511114 + 32047.31997183187*eta - 108609.45037520859*eta2)*xi
996  + (452.25136398112204 + 8353.439546391714*eta - 44531.3250037322*eta2)*xi*xi)*xi;
997 }
998 
999 /**
1000  * sigma 2 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
1001  */
1002 static double sigma2Fit(double eta, double eta2, double xi) {
1003 
1004  return -10114.056472621156 - 44631.01109458185*eta
1005  + (-6541.308761668722 - 266959.23419307504*eta + 686328.3229317984*eta2
1006  + (3405.6372187679685 - 437507.7208209015*eta + 1.6318171307344697e6*eta2)*xi
1007  + (-7462.648563007646 - 114585.25177153319*eta + 674402.4689098676*eta2)*xi*xi)*xi;
1008 }
1009 
1010 /**
1011  * sigma 3 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
1012  */
1013 static double sigma3Fit(double eta, double eta2, double xi) {
1014 
1015  return 22933.658273436497 + 230960.00814979506*eta
1016  + (14961.083974183695 + 1.1940181342318142e6*eta - 3.1042239693052764e6*eta2
1017  + (-3038.166617199259 + 1.8720322849093592e6*eta - 7.309145012085539e6*eta2)*xi
1018  + (42738.22871475411 + 467502.018616601*eta - 3.064853498512499e6*eta2)*xi*xi)*xi;
1019 }
1020 
1021 /**
1022  * sigma 4 phenom coefficient. See corresponding row in Table 5 arXiv:1508.07253
1023  */
1024 static double sigma4Fit(double eta, double eta2, double xi) {
1025 
1026  return -14621.71522218357 - 377812.8579387104*eta
1027  + (-9608.682631509726 - 1.7108925257214056e6*eta + 4.332924601416521e6*eta2
1028  + (-22366.683262266528 - 2.5019716386377467e6*eta + 1.0274495902259542e7*eta2)*xi
1029  + (-85360.30079034246 - 570025.3441737515*eta + 4.396844346849777e6*eta2)*xi*xi)*xi;
1030 }
1031 
1032 /**
1033  * Ansatz for the inspiral phase.
1034  * We call the LAL TF2 coefficients here.
1035  * The exact values of the coefficients used are given
1036  * as comments in the top of this file
1037  * Defined by Equation 27 and 28 arXiv:1508.07253
1038  */
1039 static double PhiInsAnsatzInt(double Mf, UsefulPowers *powers_of_Mf, PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
1040 {
1041  XLAL_CHECK(0 != pn, XLAL_EFAULT, "pn is NULL");
1042 
1043  // Assemble PN phasing series
1044  const double v = powers_of_Mf->third * powers_of_pi.third;
1045  const double logv = log(v);
1046 
1047  double phasing = prefactors->initial_phasing;
1048 
1049  phasing += prefactors->two_thirds * powers_of_Mf->two_thirds;
1050  phasing += prefactors->third * powers_of_Mf->third;
1051  phasing += prefactors->third_with_logv * logv * powers_of_Mf->third;
1052  phasing += prefactors->logv * logv;
1053  phasing += prefactors->minus_third * powers_of_Mf->m_third;
1054  phasing += prefactors->minus_two_thirds * powers_of_Mf->m_two_thirds;
1055  phasing += prefactors->minus_one * powers_of_Mf->inv;
1056  phasing += prefactors->minus_four_thirds / powers_of_Mf->four_thirds;
1057  phasing += prefactors->minus_five_thirds * powers_of_Mf->m_five_thirds; // * v^0
1058 
1059  // Now add higher order terms that were calibrated for PhenomD
1060  phasing += ( prefactors->one * Mf + prefactors->four_thirds * powers_of_Mf->four_thirds
1061  + prefactors->five_thirds * powers_of_Mf->five_thirds
1062  + prefactors->two * powers_of_Mf->two
1063  ) * p->etaInv;
1064 
1065  return phasing;
1066 }
1067 
1069 {
1070  XLAL_CHECK(0 != p, XLAL_EFAULT, "p is NULL");
1071  XLAL_CHECK(0 != prefactors, XLAL_EFAULT, "prefactors is NULL");
1072 
1073  double sigma1 = p->sigma1;
1074  double sigma2 = p->sigma2;
1075  double sigma3 = p->sigma3;
1076  double sigma4 = p->sigma4;
1077 
1078  // PN phasing series
1079  prefactors->initial_phasing = pn->v[5] - LAL_PI_4;
1080  prefactors->two_thirds = pn->v[7] * powers_of_pi.two_thirds;
1081  prefactors->third = pn->v[6] * powers_of_pi.third;
1082  prefactors->third_with_logv = pn->vlogv[6] * powers_of_pi.third;
1083  prefactors->logv = pn->vlogv[5];
1084  prefactors->minus_third = pn->v[4] * powers_of_pi.m_third;
1085  prefactors->minus_two_thirds = pn->v[3] * powers_of_pi.m_two_thirds;
1086  prefactors->minus_one = pn->v[2] * powers_of_pi.inv;
1087  prefactors->minus_four_thirds = pn->v[1] / powers_of_pi.four_thirds;
1088  prefactors->minus_five_thirds = pn->v[0] * powers_of_pi.m_five_thirds; // * v^0
1089 
1090  // higher order terms that were calibrated for PhenomD
1091  prefactors->one = sigma1;
1092  prefactors->four_thirds = sigma2 * 0.75;
1093  prefactors->five_thirds = sigma3 * 0.6;
1094  prefactors->two = sigma4 * 0.5;
1095 
1096  return XLAL_SUCCESS;
1097 }
1098 
1099 /**
1100  * First frequency derivative of PhiInsAnsatzInt
1101  */
1103  double sigma1 = p->sigma1;
1104  double sigma2 = p->sigma2;
1105  double sigma3 = p->sigma3;
1106  double sigma4 = p->sigma4;
1107  double Pi = LAL_PI;
1108 
1109  // Assemble PN phasing series
1110  const double v = cbrt(Pi*Mf);
1111  const double logv = log(v);
1112  const double v2 = v * v;
1113  const double v3 = v * v2;
1114  const double v4 = v * v3;
1115  const double v5 = v * v4;
1116  const double v6 = v * v5;
1117  const double v7 = v * v6;
1118  const double v8 = v * v7;
1119 
1120  // Apply the correct prefactors to LAL phase coefficients to get the
1121  // phase derivative dphi / dMf = dphi/dv * dv/dMf
1122  double Dphasing = 0.0;
1123  Dphasing += 2.0 * pn->v[7] * v7;
1124  Dphasing += (pn->v[6] + pn->vlogv[6] * (1.0 + logv)) * v6;
1125  Dphasing += pn->vlogv[5] * v5;
1126  Dphasing += -1.0 * pn->v[4] * v4;
1127  Dphasing += -2.0 * pn->v[3] * v3;
1128  Dphasing += -3.0 * pn->v[2] * v2;
1129  Dphasing += -4.0 * pn->v[1] * v;
1130  Dphasing += -5.0 * pn->v[0];
1131  Dphasing /= v8 * 3.0;
1132  Dphasing *= Pi;
1133 
1134  // Now add higher order terms that were calibrated for PhenomD
1135  Dphasing += (
1136  sigma1
1137  + sigma2 * v * powers_of_pi.m_third
1138  + sigma3 * v2 * powers_of_pi.m_two_thirds
1139  + (sigma4*powers_of_pi.inv) * v3
1140  ) * p->etaInv;
1141 
1142  return Dphasing;
1143 }
1144 
1145 ///////////////////////////////// Phase: glueing function ////////////////////////////////
1146 
1147 /**
1148  * A struct containing all the parameters that need to be calculated
1149  * to compute the phenomenological phase
1150  */
1151 static void ComputeIMRPhenomDPhaseCoefficients(IMRPhenomDPhaseCoefficients *p, double eta, double chi1, double chi2, double finspin, LALDict *extraParams) {
1152 
1153  // Convention m1 >= m2
1154  p->eta = eta;
1155  p->etaInv = 1./eta;
1156  p->chi1 = chi1;
1157  p->chi2 = chi2;
1158  double eta2 = eta*eta;
1159  p->eta2 = eta2;
1160  p->Seta = sqrt(1.0 - 4.0*eta);
1161 
1162  p->q = 0.5*(1.0 + p->Seta - 2.0*eta)*p->etaInv;
1163  p->chi = chiPN(p->Seta, eta, chi1, chi2);
1164  double xi = -1.0 + p->chi;
1165 
1166  p->sigma1 = sigma1Fit(eta, eta2, xi);
1167  p->sigma2 = sigma2Fit(eta, eta2, xi);
1168  p->sigma3 = sigma3Fit(eta, eta2, xi);
1169  p->sigma4 = sigma4Fit(eta, eta2, xi);
1170 
1171  p->beta1 = beta1Fit(eta, eta2, xi);
1172  p->beta2 = beta2Fit(eta, eta2, xi);
1173  p->beta3 = beta3Fit(eta, eta2, xi);
1174 
1175  p->alpha1 = alpha1Fit(eta, eta2, xi);
1176  p->alpha2 = alpha2Fit(eta, eta2, xi);
1177  p->alpha3 = alpha3Fit(eta, eta2, xi);
1178  p->alpha4 = alpha4Fit(eta, eta2, xi);
1179  p->alpha5 = alpha5Fit(eta, eta2, xi);
1180 
1181  p->fRD = fring(eta, chi1, chi2, finspin);
1182  p->fDM = fdamp(eta, chi1, chi2, finspin);
1183 
1184  p->sigma1*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDSigma1(extraParams));
1185  p->sigma2*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDSigma2(extraParams));
1186  p->sigma3*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDSigma3(extraParams));
1187  p->sigma4*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDSigma4(extraParams));
1188  p->beta1*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDBeta1(extraParams));
1189  p->beta2*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDBeta2(extraParams));
1190  p->beta3*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDBeta3(extraParams));
1191  p->alpha1*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDAlpha1(extraParams));
1192  p->alpha2*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDAlpha2(extraParams));
1193  p->alpha3*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDAlpha3(extraParams));
1194  p->alpha4*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDAlpha4(extraParams));
1195  p->alpha5*=(1.0+XLALSimInspiralWaveformParamsLookupNonGRDAlpha5(extraParams));
1196 
1197 }
1198 
1199 /**
1200  * This function aligns the three phase parts (inspiral, intermediate and merger-rindown)
1201  * such that they are c^1 continuous at the transition frequencies
1202  * Defined in VIII. Full IMR Waveforms arXiv:1508.07253
1203  * Rholm was added when IMRPhenomHM (high mode) was added.
1204  * Rholm = fRD22/fRDlm. For PhenomD (only (l,m)=(2,2)) this is just equal
1205  * to 1. and PhenomD is recovered.
1206  * Taulm = fDMlm/fDM22. Ratio of ringdown damping times.
1207  * Again, when Taulm = 1.0 then PhenomD is recovered.
1208  */
1210 {
1211  double etaInv = p->etaInv;
1212 
1213  // Transition frequencies
1214  // Defined in VIII. Full IMR Waveforms arXiv:1508.07253
1215  p->fInsJoin=PHI_fJoin_INS;
1216  p->fMRDJoin=0.5*p->fRD;
1217 
1218  // Compute C1Int and C2Int coeffs
1219  // Equations to solve for to get C(1) continuous join
1220  // PhiIns (f) = PhiInt (f) + C1Int + C2Int f
1221  // Joining at fInsJoin
1222  // PhiIns (fInsJoin) = PhiInt (fInsJoin) + C1Int + C2Int fInsJoin
1223  // PhiIns'(fInsJoin) = PhiInt'(fInsJoin) + C2Int
1224  double DPhiIns = DPhiInsAnsatzInt(PHI_fJoin_INS, p, pn);
1225  double DPhiInt = DPhiIntAnsatz(PHI_fJoin_INS, p);
1226  p->C2Int = DPhiIns - DPhiInt;
1227 
1228  UsefulPowers powers_of_fInsJoin;
1229  init_useful_powers(&powers_of_fInsJoin, PHI_fJoin_INS);
1230  p->C1Int = PhiInsAnsatzInt(PHI_fJoin_INS, &powers_of_fInsJoin, prefactors, p, pn)
1231  - etaInv * PhiIntAnsatz(PHI_fJoin_INS, p) - p->C2Int * PHI_fJoin_INS;
1232 
1233  // Compute C1MRD and C2MRD coeffs
1234  // Equations to solve for to get C(1) continuous join
1235  // PhiInsInt (f) = PhiMRD (f) + C1MRD + C2MRD f
1236  // Joining at fMRDJoin
1237  // Where \[Phi]InsInt(f) is the \[Phi]Ins+\[Phi]Int joined function
1238  // PhiInsInt (fMRDJoin) = PhiMRD (fMRDJoin) + C1MRD + C2MRD fMRDJoin
1239  // PhiInsInt'(fMRDJoin) = PhiMRD'(fMRDJoin) + C2MRD
1240  // temporary Intermediate Phase function to Join up the Merger-Ringdown
1241  double PhiIntTempVal = etaInv * PhiIntAnsatz(p->fMRDJoin, p) + p->C1Int + p->C2Int*p->fMRDJoin;
1242  double DPhiIntTempVal = DPhiIntTemp(p->fMRDJoin, p);
1243  double DPhiMRDVal = DPhiMRD(p->fMRDJoin, p, Rholm, Taulm);
1244  p->C2MRD = DPhiIntTempVal - DPhiMRDVal;
1245  p->C1MRD = PhiIntTempVal - etaInv * PhiMRDAnsatzInt(p->fMRDJoin, p, Rholm, Taulm) - p->C2MRD*p->fMRDJoin;
1246 }
1247 
1248 /**
1249  * This function computes the IMR phase given phenom coefficients.
1250  * Defined in VIII. Full IMR Waveforms arXiv:1508.07253
1251  * Rholm was added when IMRPhenomHM (high mode) was added.
1252  * Rholm = fRD22/fRDlm. For PhenomD (only (l,m)=(2,2)) this is just equal
1253  * to 1. and PhenomD is recovered.
1254  * Taulm = fDMlm/fDM22. Ratio of ringdown damping times.
1255  * Again, when Taulm = 1.0 then PhenomD is recovered.
1256  */
1257 static double IMRPhenDPhase(double f, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, UsefulPowers *powers_of_f, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
1258 {
1259  // Defined in VIII. Full IMR Waveforms arXiv:1508.07253
1260  // The inspiral, intermendiate and merger-ringdown phase parts
1261 
1262  // split the calculation to just 1 of 3 possible mutually exclusive ranges
1263  if (!StepFunc_boolean(f, p->fInsJoin)) // Inspiral range
1264  {
1265  double PhiIns = PhiInsAnsatzInt(f, powers_of_f, prefactors, p, pn);
1266  return PhiIns;
1267  }
1268 
1269  if (StepFunc_boolean(f, p->fMRDJoin)) // MRD range
1270  {
1271  double PhiMRD = p->etaInv * PhiMRDAnsatzInt(f, p, Rholm, Taulm) + p->C1MRD + p->C2MRD * f;
1272  return PhiMRD;
1273  }
1274 
1275  // Intermediate range
1276  double PhiInt = p->etaInv * PhiIntAnsatz(f, p) + p->C1Int + p->C2Int * f;
1277  return PhiInt;
1278 }
1279 
1280 /**
1281  * Subtract 3PN spin-spin term below as this is in LAL's TaylorF2 implementation
1282  * (LALSimInspiralPNCoefficients.c -> XLALSimInspiralPNPhasing_F2), but
1283  * was not available when PhenomD was tuned.
1284  */
1285 static double Subtract3PNSS(double m1, double m2, double M, double eta, double chi1, double chi2){
1286  REAL8 m1M = m1 / M;
1287  REAL8 m2M = m2 / M;
1288  REAL8 pn_ss3 = (326.75L/1.12L + 557.5L/1.8L*eta)*eta*chi1*chi2;
1289  pn_ss3 += ((4703.5L/8.4L+2935.L/6.L*m1M-120.L*m1M*m1M) + (-4108.25L/6.72L-108.5L/1.2L*m1M+125.5L/3.6L*m1M*m1M)) *m1M*m1M * chi1*chi1;
1290  pn_ss3 += ((4703.5L/8.4L+2935.L/6.L*m2M-120.L*m2M*m2M) + (-4108.25L/6.72L-108.5L/1.2L*m2M+125.5L/3.6L*m2M*m2M)) *m2M*m2M * chi2*chi2;
1291  return pn_ss3;
1292 }
UsefulPowers powers_of_pi
useful powers of LAL_PI, calculated once and kept constant - to be initied with a call to init_useful...
static const double QNMData_a[]
#define PHI_fJoin_INS
Dimensionless frequency (Mf) at which the inspiral phase switches to the intermediate phase.
#define AMP_fJoin_INS
Dimensionless frequency (Mf) at which the inspiral amplitude switches to the intermediate amplitude.
static const double QNMData_fring[]
static const int QNMData_length
static const double QNMData_fdamp[]
static double sigma1Fit(double eta, double eta2, double xi)
sigma 1 phenom coefficient.
static double beta2Fit(double eta, double eta2, double xi)
beta 2 phenom coefficient.
static double PhiMRDAnsatzInt(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm)
Ansatz for the merger-ringdown phase Equation 14 arXiv:1508.07253 Rholm was added when IMRPhenomHM (h...
static double DAmpMRDAnsatz(double f, IMRPhenomDAmplitudeCoefficients *p)
first frequency derivative of AmpMRDAnsatz
static void ComputeIMRPhenDPhaseConnectionCoefficients(IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
This function aligns the three phase parts (inspiral, intermediate and merger-rindown) such that they...
static double alpha2Fit(double eta, double eta2, double xi)
alpha 2 phenom coefficient.
static double DAmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, IMRPhenomDAmplitudeCoefficients *p)
Take the AmpInsAnsatz expression and compute the first derivative with respect to frequency to get th...
static double delta4_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double amp0Func(double eta)
amplitude scaling factor defined by eq.
static double IMRPhenDPhase(double f, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, UsefulPowers *powers_of_f, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
This function computes the IMR phase given phenom coefficients.
static int init_phi_ins_prefactors(PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
static double alpha1Fit(double eta, double eta2, double xi)
alpha 1 phenom coefficient.
static double sigma3Fit(double eta, double eta2, double xi)
sigma 3 phenom coefficient.
static double beta3Fit(double eta, double eta2, double xi)
beta 3 phenom coefficient.
static double rho2_fun(double eta, double eta2, double xi)
rho_2 phenom coefficient.
static double AmpMRDAnsatz(double f, IMRPhenomDAmplitudeCoefficients *p)
Ansatz for the merger-ringdown amplitude.
static double beta1Fit(double eta, double eta2, double xi)
beta 1 phenom coefficient.
static double rho1_fun(double eta, double eta2, double xi)
rho_1 phenom coefficient.
static double FinalSpin0815(double eta, double chi1, double chi2)
Wrapper function for FinalSpin0815_s.
static double delta2_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double fdamp(double eta, double chi1, double chi2, double finspin)
fdamp is the complex part of the ringdown frequency 1508.07250 figure 9
static double alpha3Fit(double eta, double eta2, double xi)
alpha 3 phenom coefficient.
static double fmaxCalc(IMRPhenomDAmplitudeCoefficients *p)
Equation 20 arXiv:1508.07253 (called f_peak in paper) analytic location of maximum of AmpMRDAnsatz.
static double chiPN(double Seta, double eta, double chi1, double chi2)
PN reduced spin parameter See Eq 5.9 in http://arxiv.org/pdf/1107.1267v2.pdf.
static void ComputeIMRPhenomDPhaseCoefficients(IMRPhenomDPhaseCoefficients *p, double eta, double chi1, double chi2, double finspin, LALDict *extraParams)
A struct containing all the parameters that need to be calculated to compute the phenomenological pha...
static double gamma2_fun(double eta, double eta2, double xi)
gamma 2 phenom coefficient.
static double AmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, AmpInsPrefactors *prefactors)
Inspiral amplitude plus rho phenom coefficents.
static double DPhiIntAnsatz(double Mf, IMRPhenomDPhaseCoefficients *p)
First frequency derivative of PhiIntAnsatz (this time with 1.
static double fring(double eta, double chi1, double chi2, double finspin)
fring is the real part of the ringdown frequency 1508.07250 figure 9
static void ComputeIMRPhenomDAmplitudeCoefficients(IMRPhenomDAmplitudeCoefficients *p, double eta, double chi1, double chi2, double finspin)
A struct containing all the parameters that need to be calculated to compute the phenomenological amp...
static double alpha5Fit(double eta, double eta2, double xi)
alpha 5 phenom coefficient.
static double PhiInsAnsatzInt(double Mf, UsefulPowers *powers_of_Mf, PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
Ansatz for the inspiral phase.
static double delta3_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double sigma2Fit(double eta, double eta2, double xi)
sigma 2 phenom coefficient.
static double FinalSpin0815_s(double eta, double s)
Formula to predict the final spin.
static void ComputeDeltasFromCollocation(IMRPhenomDAmplitudeCoefficients *p)
Calculates delta_i's Method described in arXiv:1508.07253 section 'Region IIa - intermediate'.
static double delta1_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double gamma1_fun(double eta, double eta2, double xi)
gamma 1 phenom coefficient.
static double Subtract3PNSS(double m1, double m2, double M, double eta, double chi1, double chi2)
Subtract 3PN spin-spin term below as this is in LAL's TaylorF2 implementation (LALSimInspiralPNCoeffi...
static double alpha4Fit(double eta, double eta2, double xi)
alpha 4 phenom coefficient.
static double rho3_fun(double eta, double eta2, double xi)
rho_3 phenom coefficient.
static double delta0_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
The following functions (delta{0,1,2,3,4}_fun) were derived in mathematica according to the constrain...
static double PhiIntAnsatz(double Mf, IMRPhenomDPhaseCoefficients *p)
ansatz for the intermediate phase defined by Equation 16 arXiv:1508.07253
static double sigma4Fit(double eta, double eta2, double xi)
sigma 4 phenom coefficient.
static double AmpIntAnsatz(double Mf, IMRPhenomDAmplitudeCoefficients *p)
Ansatz for the intermediate amplitude.
static size_t NextPow2(const size_t n)
Return the closest higher power of 2.
static double IMRPhenDAmplitude(double f, IMRPhenomDAmplitudeCoefficients *p, UsefulPowers *powers_of_f, AmpInsPrefactors *prefactors)
This function computes the IMR amplitude given phenom coefficients.
static double DPhiIntTemp(double ff, IMRPhenomDPhaseCoefficients *p)
temporary instance of DPhiIntAnsatz used when computing coefficients to make the phase C(1) continuou...
static double DPhiInsAnsatzInt(double Mf, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
First frequency derivative of PhiInsAnsatzInt.
static bool StepFunc_boolean(const double t, const double t1)
‍**
static int init_amp_ins_prefactors(AmpInsPrefactors *prefactors, IMRPhenomDAmplitudeCoefficients *p)
static double gamma3_fun(double eta, double eta2, double xi)
gamma 3 phenom coefficient.
static double DPhiMRD(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm)
First frequency derivative of PhiMRDAnsatzInt Rholm was added when IMRPhenomHM (high mode) was added.
static int init_useful_powers(UsefulPowers *p, REAL8 number)
static double AmpIntColFitCoeff(double eta, double eta2, double chi)
The function name stands for 'Amplitude Intermediate Collocation Fit Coefficient' This is the 'v2' va...
Internal function for IMRPhenomD phenomenological waveform model. See LALSimIMRPhenom....
static double pow_3_of(double number)
calc cube of number without floating point 'pow'
static double pow_4_of(double number)
calc fourth power of number without floating point 'pow'
#define PI_M_SIXTH
static double pow_2_of(double number)
calc square of number without floating point 'pow'
double PhenomInternal_EradRational0815(double eta, double chi1, double chi2)
Wrapper function for EradRational0815_s.
static const REAL8 f14[]
static vector d(const double L_norm, const double J_norm, const vector roots)
Internal function that returns the coefficients "d_0", "d_2" and "d_4" from 1703.03967 corresponding ...
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDBeta2(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDAlpha2(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDAlpha4(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDAlpha5(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDSigma2(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDBeta3(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDAlpha1(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDSigma4(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDSigma3(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDBeta1(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDAlpha3(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupNonGRDSigma1(LALDict *params)
int s
Definition: bh_qnmode.c:137
REAL8 M
Definition: bh_qnmode.c:133
const double pn
const double s3
#define LAL_PI
#define LAL_PI_4
double REAL8
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_VOID(assertion,...)
XLAL_SUCCESS
XLAL_EFAULT
XLAL_EFUNC
XLAL_EDOM
list p
string status
used to cache the recurring (frequency-independent) prefactors of AmpInsAnsatz.
Structure holding all additional coefficients needed for the delta amplitude functions.
Structure holding all coefficients for the amplitude.
Structure holding all coefficients for the phase.
used to cache the recurring (frequency-independent) prefactors of PhiInsAnsatzInt.
useful powers in GW waveforms: 1/6, 1/3, 2/3, 4/3, 5/3, 2, 7/3, 8/3, -1, -1/6, -7/6,...