LALSimulation  5.4.0.1-fe68b98
LALSimNRTunedTides.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Tim Dietrich, Sebastiano Bernuzzi, Nathan Johnson-McDaniel,
3  * Shasvath J Kapadia, Francesco Pannarale and Sebastian Khan, Michael Puerrer.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with with program; see the file COPYING. If not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  * MA 02110-1301 USA
19  */
20 
21 
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <math.h>
25 #include <complex.h>
26 #include <lal/LALStdlib.h>
27 #include <lal/LALConstants.h>
28 #include <lal/Date.h>
29 #include <lal/Units.h>
30 #include <lal/LALSimIMR.h>
31 
32 #include "LALSimNRTunedTides.h"
34 
35 #ifdef __GNUC__
36 #define UNUSED __attribute__ ((unused))
37 #else
38 #define UNUSED
39 #endif
40 
41 /**
42  * Planck taper window
43  */
44 static REAL8 PlanckTaper(const REAL8 t, const REAL8 t1, const REAL8 t2) {
45  REAL8 taper;
46  if (t <= t1)
47  taper = 0.;
48  else if (t >= t2)
49  taper = 1.;
50  else
51  taper = 1. / (exp((t2 - t1)/(t - t1) + (t2 - t1)/(t - t2)) + 1.);
52 
53  return taper;
54 }
55 
56 /**
57  * function to swap masses and lambda to enforce m1 >= m2
58  */
59 static int EnforcePrimaryMassIsm1(REAL8 *m1, REAL8 *m2, REAL8 *lambda1, REAL8 *lambda2){
60  if ((*m1 == *m2) && (*lambda1 != *lambda2))
61  XLALPrintWarning("m1 == m2 (%g), but lambda1 != lambda2 (%g, %g).\n", *m1, *lambda1, *lambda2);
62 
63  REAL8 lambda1_tmp, lambda2_tmp, m1_tmp, m2_tmp;
64  if (*m1>=*m2) {
65  lambda1_tmp = *lambda1;
66  lambda2_tmp = *lambda2;
67  m1_tmp = *m1;
68  m2_tmp = *m2;
69  } else { /* swap spins and masses */
70  lambda1_tmp = *lambda2;
71  lambda2_tmp = *lambda1;
72  m1_tmp = *m2;
73  m2_tmp = *m1;
74  }
75  *m1 = m1_tmp;
76  *m2 = m2_tmp;
77  *lambda1 = lambda1_tmp;
78  *lambda2 = lambda2_tmp;
79 
80  if (*m1 < *m2)
81  XLAL_ERROR(XLAL_EDOM, "XLAL_ERROR in EnforcePrimaryMassIsm1. When trying\
82  to enfore that m1 should be the larger mass.\
83  After trying to enforce this m1 = %f and m2 = %f\n", *m1, *m2);
84 
85  return XLAL_SUCCESS;
86 }
87 
88 
89 /**
90  * convenient function to compute tidal coupling constant. Eq. 2 in arXiv:1706.02969
91  * given masses and lambda numbers
92  */
94  REAL8 m1_SI, /**< Mass of companion 1 (kg) */
95  REAL8 m2_SI, /**< Mass of companion 2 (kg) */
96  REAL8 lambda1, /**< (tidal deformability of mass 1) / m1^5 (dimensionless) */
97  REAL8 lambda2 /**< (tidal deformability of mass 2) / m2^5 (dimensionless) */
98  )
99 {
100  int errcode = EnforcePrimaryMassIsm1(&m1_SI, &m2_SI, &lambda1, &lambda2);
101  XLAL_CHECK(XLAL_SUCCESS == errcode, errcode, "EnforcePrimaryMassIsm1 failed");
102 
103  const REAL8 m1 = m1_SI / LAL_MSUN_SI;
104  const REAL8 m2 = m2_SI / LAL_MSUN_SI;
105  const REAL8 mtot = m1 + m2;
106 
107  /* Xa and Xb are the masses normalised for a total mass = 1 */
108  /* not the masses appear symmetrically so we don't need to switch them. */
109  const REAL8 Xa = m1 / mtot;
110  const REAL8 Xb = m2 / mtot;
111 
112  /* tidal coupling constant. This is the
113  kappa^T_eff = 2/13 [ (1 + 12 X_B/X_A) (X_A/C_A)^5 k^A_2 + [A <- -> B] ]
114  from Tim Dietrich */
115 
116  /* Note that 2*k_2^A/c_A^5 = 3*lambda1 */
117  const REAL8 term1 = ( 1.0 + 12.0*Xb/Xa ) * pow(Xa, 5.0) * lambda1;
118  const REAL8 term2 = ( 1.0 + 12.0*Xa/Xb ) * pow(Xb, 5.0) * lambda2;
119  const REAL8 kappa2T = (3.0/13.0) * ( term1 + term2 );
120 
121  return kappa2T;
122 }
123 
124 /**
125  * compute the merger frequency of a BNS system.
126  * Tim's new fit that incorporates mass-ratio and asymptotes to zero for large kappa2T.
127  */
129  const REAL8 mtot_MSUN, /**< total mass of system (solar masses) */
130  const REAL8 kappa2T, /**< tidal coupling constant. Eq. 2 in arXiv:1706.02969 */
131  const REAL8 q /**< mass-ratio q >= 1 */
132  )
133 {
134  if (q < 1.0) {
135  XLALPrintError("XLAL Error - %s: q (%f) should be greater or equal to unity!\n",
136  __func__, q);
138  }
139 
140  const REAL8 a_0 = 0.3586;
141  const REAL8 n_1 = 3.35411203e-2;
142  const REAL8 n_2 = 4.31460284e-5;
143  const REAL8 d_1 = 7.54224145e-2;
144  const REAL8 d_2 = 2.23626859e-4;
145 
146  const REAL8 kappa2T2 = kappa2T * kappa2T;
147 
148  const REAL8 num = 1.0 + n_1*kappa2T + n_2*kappa2T2;
149  const REAL8 den = 1.0 + d_1*kappa2T + d_2*kappa2T2;
150  const REAL8 Q_0 = a_0 / sqrt(q);
151 
152  /* dimensionless angular frequency of merger */
153  const REAL8 Momega_merger = Q_0 * (num / den);
154 
155  /* convert from angular frequency to frequency (divide by 2*pi)
156  * and then convert from
157  * dimensionless frequency to Hz (divide by mtot * LAL_MTSUN_SI)
158  */
159  const REAL8 fHz_merger = Momega_merger / (LAL_TWOPI) / (mtot_MSUN * LAL_MTSUN_SI);
160 
161  return fHz_merger;
162 }
163 
164 /**
165  * Internal function only.
166  * Function to call the frequency domain tidal correction.
167  * Equation (7) in arXiv:1706.02969
168  */
170  const REAL8 fHz, /**< Gravitational wave frequency (Hz) */
171  const REAL8 Xa, /**< Mass of companion 1 divided by total mass */
172  const REAL8 Xb, /**< Mass of companion 2 divided by total mass */
173  const REAL8 mtot, /**< total mass (Msun) */
174  const REAL8 kappa2T /**< tidal coupling constant. Eq. 2 in arXiv:1706.02969 */
175  )
176 {
177  /* NRTunedTidesFDTidalPhase is Eq 7 in arXiv:1706.02969
178  * and is a function of x = angular_orb_freq^(2/3)
179  */
180  REAL8 M_omega = LAL_PI * fHz * (mtot * LAL_MTSUN_SI); //dimensionless angular GW frequency
181 
182  REAL8 PN_x = pow(M_omega, 2.0/3.0);
183  REAL8 PN_x_2 = PN_x * PN_x;
184  REAL8 PN_x_3over2 = pow(PN_x, 3.0/2.0);
185  REAL8 PN_x_5over2 = pow(PN_x, 5.0/2.0);
186 
187  /* model parameters */
188  const REAL8 c_Newt = 2.4375; /* 39.0 / 16.0 */
189 
190  const REAL8 n_1 = -17.428;
191  const REAL8 n_3over2 = 31.867;
192  const REAL8 n_2 = -26.414;
193  const REAL8 n_5over2 = 62.362;
194 
195  const REAL8 d_1 = n_1 - 2.496; /* 3115.0/1248.0 */
196  const REAL8 d_3over2 = 36.089;
197 
198  REAL8 tidal_phase = - kappa2T * c_Newt / (Xa * Xb) * PN_x_5over2;
199 
200  REAL8 num = 1.0 + (n_1 * PN_x) + (n_3over2 * PN_x_3over2) + (n_2 * PN_x_2) + (n_5over2 * PN_x_5over2) ;
201  REAL8 den = 1.0 + (d_1 * PN_x) + (d_3over2 * PN_x_3over2) ;
202 
203  REAL8 ratio = num / den;
204 
205  tidal_phase *= ratio;
206 
207  return tidal_phase;
208 }
209 
210 /**
211  * Tidal amplitude corrections; only available for NRTidalv2;
212  * Eq 24 of arxiv:1905.06011
213  */
215  const REAL8 fHz, /**< Gravitational wave frequency (Hz) */
216  const REAL8 mtot, /**< Total mass in solar masses */
217  const REAL8 kappa2T /**< tidal coupling constant. Eq. 2 in arXiv:1706.02969 */
218  )
219 {
220  const REAL8 M_sec = (mtot * LAL_MTSUN_SI);
221 
222  REAL8 prefac = 0.0;
223  prefac = 9.0*kappa2T;
224 
225  REAL8 x = pow(LAL_PI*M_sec*fHz, 2.0/3.0);
226  REAL8 ampT = 0.0;
227  REAL8 poly = 1.0;
228  const REAL8 n1 = 4.157407407407407;
229  const REAL8 n289 = 2519.111111111111;
230  const REAL8 d = 13477.8073677;
231 
232  poly = (1.0 + n1*x + n289*pow(x, 2.89))/(1+d*pow(x,4.));
233  ampT = - prefac*pow(x,3.25)*poly;
234 
235  return ampT;
236 }
237 
238 /**
239  * Set the NRTidalv2 phase coefficients in an array for use here and in the IMRPhenomX*_NRTidalv2 implementation
240  */
242 {
243  NRTidalv2_coeffs[0] = 2.4375; // c_Newt
244  NRTidalv2_coeffs[1] = -12.615214237993088; // n_1
245  NRTidalv2_coeffs[2] = 19.0537346970349; // n_3over2
246  NRTidalv2_coeffs[3] = -21.166863146081035; // n_2
247  NRTidalv2_coeffs[4] = 90.55082156324926; // n_5over2
248  NRTidalv2_coeffs[5] = -60.25357801943598; // n_3
249  NRTidalv2_coeffs[6] = -15.111207827736678; // d_1
250  NRTidalv2_coeffs[7] = 22.195327350624694; // d_3over2
251  NRTidalv2_coeffs[8] = 8.064109635305156; // d_2
252 
253  return XLAL_SUCCESS;
254 }
255 
256 /**
257  * NRTunedTidesFDTidalPhase is Eq 22 of https://arxiv.org/abs/1905.06011
258  * and is a function of x = angular_orb_freq^(2/3)
259  */
261  const REAL8 fHz, /**< Gravitational wave frequency (Hz) */
262  const REAL8 Xa, /**< Mass of companion 1 divided by total mass */
263  const REAL8 Xb, /**< Mass of companion 2 divided by total mass */
264  const REAL8 mtot, /**< total mass (Msun) */
265  const REAL8 kappa2T /**< tidal coupling constant. Eq. 2 in arXiv:1706.02969 */
266  )
267 {
268 
269  REAL8 M_omega = LAL_PI * fHz * (mtot * LAL_MTSUN_SI); //dimensionless angular GW frequency
270  REAL8 PN_x = pow(M_omega, 2.0/3.0);
271  REAL8 PN_x_2 = PN_x * PN_x;
272  REAL8 PN_x_3 = PN_x * PN_x_2;
273  REAL8 PN_x_3over2 = pow(PN_x, 3.0/2.0);
274  REAL8 PN_x_5over2 = pow(PN_x, 5.0/2.0);
275  /* model parameters */
276  REAL8 NRTidalv2_coeffs[9];
277 
278  int errcode;
279  errcode = XLALSimNRTunedTidesSetFDTidalPhase_v2_Coeffs(NRTidalv2_coeffs);
280  XLAL_CHECK(XLAL_SUCCESS == errcode, errcode, "Setting NRTidalv2 coefficients failed.\n");
281 
282  const REAL8 c_Newt = NRTidalv2_coeffs[0];
283  const REAL8 n_1 = NRTidalv2_coeffs[1];
284  const REAL8 n_3over2 = NRTidalv2_coeffs[2];
285  const REAL8 n_2 = NRTidalv2_coeffs[3];
286  const REAL8 n_5over2 = NRTidalv2_coeffs[4];
287  const REAL8 n_3 = NRTidalv2_coeffs[5];
288  const REAL8 d_1 = NRTidalv2_coeffs[6];
289  const REAL8 d_3over2 = NRTidalv2_coeffs[7];
290  const REAL8 d_2 = NRTidalv2_coeffs[8];
291  REAL8 tidal_phase = - kappa2T * c_Newt / (Xa * Xb) * PN_x_5over2;
292  REAL8 num = 1.0 + (n_1 * PN_x) + (n_3over2 * PN_x_3over2) + (n_2 * PN_x_2) + (n_5over2 * PN_x_5over2) + (n_3 * PN_x_3);
293  REAL8 den = 1.0 + (d_1 * PN_x) + (d_3over2 * PN_x_3over2) + (d_2 * PN_x_2) ;
294  REAL8 ratio = num / den;
295  tidal_phase *= ratio;
296  return tidal_phase;
297 }
298 
299 /** Function to call amplitude tidal series only;
300  * done for convenience to use for PhenomD_NRTidalv2 and
301  * SEOBNRv4_ROM_NRTidalv2
302  */
303 
305  const REAL8Sequence *amp_tidal, /**< [out] tidal amplitude frequency series */
306  const REAL8Sequence *fHz, /**< list of input Gravitational wave Frequency [Hz or dimensionless] */
307  REAL8 m1, /**< Mass of companion 1 in solar masses */
308  REAL8 m2, /**< Mass of companion 2 in solar masses */
309  REAL8 lambda1, /**< (tidal deformability of mass 1) / m1^5 (dimensionless) */
310  REAL8 lambda2 /**< (tidal deformability of mass 2) / m2^5 (dimensionless) */
311  )
312 {
313  REAL8 m1_SI = m1 * LAL_MSUN_SI;
314  REAL8 m2_SI = m2 * LAL_MSUN_SI;
315  REAL8 f_dim_to_Hz;
316  int errcode = EnforcePrimaryMassIsm1(&m1_SI, &m2_SI, &lambda1, &lambda2);
317  XLAL_CHECK(XLAL_SUCCESS == errcode, errcode, "EnforcePrimaryMassIsm1 failed");
318 
319  if( lambda1 < 0 || lambda2 < 0 )
320  XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for NRTidal models", lambda1, lambda2);
321 
322 
323  const REAL8 mtot = m1 + m2;
324  /* SEOBNRv4ROM_NRTidalv2 and IMRPhenomD_NRTidalv2 deal with dimensionless freqs and freq in Hz;
325  * If the value corresponding to the last index is above 1, we are safe to assume a frequency given in Hz,
326  * otherwise a dimensionless frequency
327  */
328 
329  if ((*fHz).data[(*fHz).length - 1] > 1.)
330  f_dim_to_Hz = 1.;
331  else
332  f_dim_to_Hz = mtot*LAL_MTSUN_SI;
333 
334  /* tidal coupling constant.*/
335  const REAL8 kappa2T = XLALSimNRTunedTidesComputeKappa2T(m1_SI, m2_SI, lambda1, lambda2);
336 
337  for(UINT4 i = 0; i < (*fHz).length; i++)
338  (*amp_tidal).data[i] = SimNRTunedTidesFDTidalAmplitude((*fHz).data[i]/f_dim_to_Hz, mtot, kappa2T);
339 
340  return XLAL_SUCCESS;
341 }
342 
343 /**
344  * Function to call the frequency domain tidal correction
345  * over an array of input frequencies. This is
346  * Equation (7) in arXiv:1706.02969 when NRTidal_version is NRTidal_V,
347  * or Equations (17)-(21) (for phasing) and Equation (24) (for amplitude)
348  * in arXiv:1905.06011 when NRTidal_version is NRTidalv2_V,
349  * or Equations (17)-(21) in arXiv:1905.06011 when NRTidal_version is NRTidalv2NoAmpCorr_V.
350  * NoNRT_V specifies NO tidal phasing or amplitude is being added.
351  * Note internally we use m1>=m2 - this is enforced in the code.
352  * So any can be supplied
353  *
354  * The model for the tidal phase correction in NRTidal_V/NRTidalv2_V was calibrated
355  * up to mass-ratio q=1.5 and kappa2T in [40, 5000].
356  * The upper kappa2T limit is reached roughly for a
357  * 1.4+1.4 BNS with lambda = 2700 on both NSs.
358  * In the high mass-ratio limit, the BNS merger frequency defined in
359  * XLALSimNRTunedTidesMergerFrequency() asymptotes to zero. The waveform
360  * amplitude should be tapered away starting at this frequency.
361  * Therefore, no explicit limits are enforced.
362  */
363 
365  const REAL8Sequence *phi_tidal, /**< [out] tidal phase frequency series */
366  const REAL8Sequence *amp_tidal, /**< [out] tidal amplitude frequency series */
367  const REAL8Sequence *planck_taper, /**< [out] planck tapering to be applied on overall signal */
368  const REAL8Sequence *fHz, /**< list of input Gravitational wave Frequency in Hz to evaluate */
369  REAL8 m1_SI, /**< Mass of companion 1 (kg) */
370  REAL8 m2_SI, /**< Mass of companion 2 (kg) */
371  REAL8 lambda1, /**< (tidal deformability of mass 1) / m1^5 (dimensionless) */
372  REAL8 lambda2, /**< (tidal deformability of mass 2) / m2^5 (dimensionless) */
373  NRTidal_version_type NRTidal_version /** < one of NRTidal_V, NRTidalv2_V or NRTidalv2NoAmpCorr_V or NoNRT_V */
374  )
375 {
376  /* NOTE: internally m1 >= m2
377  * This is enforced in the code below and we swap the lambda's
378  * accordingly.
379  */
380  int errcode = EnforcePrimaryMassIsm1(&m1_SI, &m2_SI, &lambda1, &lambda2);
381  XLAL_CHECK(XLAL_SUCCESS == errcode, errcode, "EnforcePrimaryMassIsm1 failed");
382 
383  if( lambda1 < 0 || lambda2 < 0 )
384  XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for NRTidal models", lambda1, lambda2);
385 
386  const REAL8 m1 = m1_SI / LAL_MSUN_SI;
387  const REAL8 m2 = m2_SI / LAL_MSUN_SI;
388  const REAL8 mtot = m1 + m2;
389  const REAL8 q = m1 / m2;
390 
391  /* Xa and Xb are the masses normalised for a total mass = 1 */
392  const REAL8 Xa = m1 / mtot;
393  const REAL8 Xb = m2 / mtot;
394 
395  /* tidal coupling constant.*/
396  const REAL8 kappa2T = XLALSimNRTunedTidesComputeKappa2T(m1_SI, m2_SI, lambda1, lambda2);
397 
398  /* Prepare tapering of amplitude beyond merger frequency */
399  const REAL8 fHz_mrg = XLALSimNRTunedTidesMergerFrequency(mtot, kappa2T, q);
400 
401  const REAL8 fHz_end_taper = 1.2*fHz_mrg;
402  if (NRTidal_version == NRTidal_V) {
403  for(UINT4 i = 0; i < (*fHz).length; i++){
404  (*phi_tidal).data[i] = SimNRTunedTidesFDTidalPhase((*fHz).data[i], Xa, Xb, mtot, kappa2T);
405  (*planck_taper).data[i] = 1.0 - PlanckTaper((*fHz).data[i], fHz_mrg, fHz_end_taper);
406  }
407  }
408  else if (NRTidal_version == NRTidalv2_V) {
409  for(UINT4 i = 0; i < (*fHz).length; i++) {
410  (*phi_tidal).data[i] = SimNRTunedTidesFDTidalPhase_v2((*fHz).data[i], Xa, Xb, mtot, kappa2T);
411  (*amp_tidal).data[i] = SimNRTunedTidesFDTidalAmplitude((*fHz).data[i], mtot, kappa2T);
412  (*planck_taper).data[i] = 1.0 - PlanckTaper((*fHz).data[i], fHz_mrg, fHz_end_taper);
413  }
414  }
415  else if (NRTidal_version == NRTidalv2NSBH_V) {
416  for(UINT4 i = 0; i < (*fHz).length; i++) {
417  (*phi_tidal).data[i] = SimNRTunedTidesFDTidalPhase_v2((*fHz).data[i], Xa, Xb, mtot, kappa2T);
418  (*planck_taper).data[i] = 1.0;
419  }
420  }
421  else if (NRTidal_version == NRTidalv2NoAmpCorr_V) {
422  for(UINT4 i = 0; i < (*fHz).length; i++) {
423  (*phi_tidal).data[i] = SimNRTunedTidesFDTidalPhase_v2((*fHz).data[i], Xa, Xb, mtot, kappa2T);
424  (*planck_taper).data[i] = 1.0 - PlanckTaper((*fHz).data[i], fHz_mrg, fHz_end_taper);
425  }
426  }
427  else if (NRTidal_version == NoNRT_V)
428  XLAL_ERROR( XLAL_EINVAL, "Trying to add NRTides to a BBH waveform!" );
429  else
430  XLAL_ERROR( XLAL_EINVAL, "Unknown version of NRTidal being used! At present, NRTidal_V, NRTidalv2_V, NRTidalv2NSBH_V, NRTidalv2NoAmpCorr_V and NoNRT_V are the only known ones!" );
431 
432  return XLAL_SUCCESS;
433 }
434 
435 /**
436  * Function to add 3.5PN spin-squared and 3.5PN spin-cubed terms.
437  * The spin-squared terms occur with the spin-induced quadrupole moment terms
438  * while the spin-cubed terms occur with both spin-induced quadrupole as well as
439  * octupole moments. The terms are computed in arXiv:1806.01772 and are
440  * explicitly written out in Eq 27 of arXiv:1905.06011. The following terms
441  * are specifically meant for BNS systems, and are added to the NRTidalv2
442  * extensions of the approximants IMRPhenomPv2, IMRPhenomD and SEOBNRv4_ROM.
443  */
444 
446  REAL8 *SS_3p5PN, /**< 3.5PN spin-spin tail term containing spin-induced quadrupole moment */
447  REAL8 *SSS_3p5PN, /**< 3.5 PN spin cubed term containing spin-induced octupole moment */
448  REAL8 X_A, /**< Mass fraction m_1/M for first component of binary */
449  REAL8 X_B, /**< Mass fraction m_2/M for second component of binary */
450  REAL8 chi1, /**< Aligned component of spin vector of first component of binary */
451  REAL8 chi2, /**< Aligned component of spin vector of second component of binary */
452  REAL8 quadparam1, /**< Spin-induced quadrupole moment parameter for component 1 */
453  REAL8 quadparam2 /**< Spin-induced quadrupole moment parameter for component 2 */
454  )
455 {
456  REAL8 chi1_sq = 0., chi2_sq = 0.;
457  REAL8 X_Asq = 0., X_Bsq = 0.;
458  REAL8 octparam1 = 0, octparam2 = 0.;
459 
460  X_Asq = X_A*X_A;
461  X_Bsq = X_B*X_B;
462 
463  chi1_sq = chi1*chi1;
464  chi2_sq = chi2*chi2;
465 
466  /* Remove -1 to account for BBH baseline*/
469 
470  *SS_3p5PN = - 400.*LAL_PI*(quadparam1-1.)*chi1_sq*X_Asq - 400.*LAL_PI*(quadparam2-1.)*chi2_sq*X_Bsq;
471  *SSS_3p5PN = 10.*((X_Asq+308./3.*X_A)*chi1+(X_Bsq-89./3.*X_B)*chi2)*(quadparam1-1.)*X_Asq*chi1_sq
472  + 10.*((X_Bsq+308./3.*X_B)*chi2+(X_Asq-89./3.*X_A)*chi1)*(quadparam2-1.)*X_Bsq*chi2_sq
473  - 440.*octparam1*X_A*X_Asq*chi1_sq*chi1 - 440.*octparam2*X_B*X_Bsq*chi2_sq*chi2;
474 }
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 ...
void XLALSimInspiralGetHOSpinTerms(REAL8 *SS_3p5PN, REAL8 *SSS_3p5PN, REAL8 X_A, REAL8 X_B, REAL8 chi1, REAL8 chi2, REAL8 quadparam1, REAL8 quadparam2)
Function to add 3.5PN spin-squared and 3.5PN spin-cubed terms.
int XLALSimNRTunedTidesFDTidalPhaseFrequencySeries(const REAL8Sequence *phi_tidal, const REAL8Sequence *amp_tidal, const REAL8Sequence *planck_taper, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2, NRTidal_version_type NRTidal_version)
Function to call the frequency domain tidal correction over an array of input frequencies.
static REAL8 SimNRTunedTidesFDTidalAmplitude(const REAL8 fHz, const REAL8 mtot, const REAL8 kappa2T)
Tidal amplitude corrections; only available for NRTidalv2; Eq 24 of arxiv:1905.06011.
static REAL8 PlanckTaper(const REAL8 t, const REAL8 t1, const REAL8 t2)
Planck taper window.
static double SimNRTunedTidesFDTidalPhase_v2(const REAL8 fHz, const REAL8 Xa, const REAL8 Xb, const REAL8 mtot, const REAL8 kappa2T)
NRTunedTidesFDTidalPhase is Eq 22 of https://arxiv.org/abs/1905.06011 and is a function of x = angula...
static int EnforcePrimaryMassIsm1(REAL8 *m1, REAL8 *m2, REAL8 *lambda1, REAL8 *lambda2)
function to swap masses and lambda to enforce m1 >= m2
int XLALSimNRTunedTidesSetFDTidalPhase_v2_Coeffs(REAL8 *NRTidalv2_coeffs)
Set the NRTidalv2 phase coefficients in an array for use here and in the IMRPhenomX*_NRTidalv2 implem...
double XLALSimNRTunedTidesMergerFrequency(const REAL8 mtot_MSUN, const REAL8 kappa2T, const REAL8 q)
compute the merger frequency of a BNS system.
static double SimNRTunedTidesFDTidalPhase(const REAL8 fHz, const REAL8 Xa, const REAL8 Xb, const REAL8 mtot, const REAL8 kappa2T)
Internal function only.
int XLALSimNRTunedTidesFDTidalAmplitudeFrequencySeries(const REAL8Sequence *amp_tidal, const REAL8Sequence *fHz, REAL8 m1, REAL8 m2, REAL8 lambda1, REAL8 lambda2)
Function to call amplitude tidal series only; done for convenience to use for PhenomD_NRTidalv2 and S...
double XLALSimNRTunedTidesComputeKappa2T(REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2)
convenient function to compute tidal coupling constant.
REAL8 XLALSimUniversalRelationSpinInducedOctupoleVSSpinInducedQuadrupole(REAL8 qm_def)
double i
Definition: bh_ringdown.c:118
#define LAL_MSUN_SI
#define LAL_PI
#define LAL_TWOPI
#define LAL_MTSUN_SI
double REAL8
uint32_t UINT4
NRTidal_version_type
Definition: LALSimIMR.h:80
@ NRTidalv2NoAmpCorr_V
version NRTidalv2, without amplitude corrections
Definition: LALSimIMR.h:83
@ NRTidal_V
version NRTidal: based on https://arxiv.org/pdf/1706.02969.pdf
Definition: LALSimIMR.h:81
@ NoNRT_V
special case for PhenomPv2 BBH baseline
Definition: LALSimIMR.h:85
@ NRTidalv2NSBH_V
version NRTidalv2: https://arxiv.org/abs/1905.06011 with amplitude corrections for NSBH (used for SEO...
Definition: LALSimIMR.h:84
@ NRTidalv2_V
version NRTidalv2: https://arxiv.org/abs/1905.06011
Definition: LALSimIMR.h:82
static const INT4 q
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EDOM
XLAL_EINVAL
list x