LALSimulation  5.4.0.1-fe68b98
LALSimInspiralTaylorF2.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 Jolien Creighton, B.S. Sathyaprakash, Thomas Cokelaer
3  * Copyright (C) 2012 Leo Singer, Evan Ochsner, Les Wade, Alex Nitz
4  * Assembled from code found in:
5  * - LALInspiralStationaryPhaseApproximation2.c
6  * - LALInspiralChooseModel.c
7  * - LALInspiralSetup.c
8  * - LALSimInspiralTaylorF2ReducedSpin.c
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with with program; see the file COPYING. If not, write to the
22  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23  * MA 02110-1301 USA
24  */
25 
26 #include <stdlib.h>
27 #include <math.h>
28 #include <lal/Date.h>
29 #include <lal/FrequencySeries.h>
30 #include <lal/LALConstants.h>
31 #include <lal/Sequence.h>
32 #include <lal/LALDatatypes.h>
33 #include <lal/LALSimInspiralEOS.h>
34 #include <lal/LALSimInspiral.h>
35 #include <lal/Units.h>
36 #include <lal/XLALError.h>
37 #include <lal/AVFactories.h>
39 
40 #ifndef _OPENMP
41 #define omp ignore
42 #endif
43 
44 /**
45  * @addtogroup LALSimInspiralTaylorXX_c
46  * @{
47  *
48  * @review TaylorF2 routines reviewed by Frank Ohme, Andrew Lundgren, Alex Nitz,
49  * Alex Nielsen, Salvatore Vitale, Jocelyn Read, Sebastian Khan.
50  * The review concluded with git hash 6106138b2140ffb11bc38fc914e0a1de7082dc4d (Nov 2014)
51  * Additional tidal terms up to 7.5PN order reviewed by Ohme, Haney, Khan, Samajdar,
52  * Riemenschneider, Setyawati, Hinderer. Concluded with git hash
53  * f15615215a7e70488d32137a827d63192cbe3ef6 (February 2019).
54  *
55  * @note If not specified explicitly by the user, the default tidal order will be
56  * chosen as 7.0PN, based on the good performance found in
57  * https://arxiv.org/pdf/1804.02235.pdf (Fig. 10). However, the user is free to specify
58  * any tidal order up to 7.5PN passing the relevant flag through the LALDict.
59  *
60  * @name Routines for TaylorF2 Waveforms
61  * @sa
62  * Section IIIF of Alessandra Buonanno, Bala R Iyer, Evan
63  * Ochsner, Yi Pan, and B S Sathyaprakash, "Comparison of post-Newtonian
64  * templates for compact binary inspiral signals in gravitational-wave
65  * detectors", Phys. Rev. D 80, 084043 (2009), arXiv:0907.0700v1
66  *
67  * @{
68  */
69 
70 /** \brief Returns structure containing TaylorF2 phasing coefficients for given
71  * physical parameters.
72  */
74  PNPhasingSeries **pn, /**< phasing coefficients (output) */
75  const REAL8 m1, /**< mass of body 1 */
76  const REAL8 m2, /**< mass of body 2 */
77  const REAL8 chi1, /**< aligned spin parameter of body 1 */
78  const REAL8 chi2, /**< aligned spin parameter of body 2 */
79  LALDict *p /**< LAL dictionary containing accessory parameters */
80  )
81 {
82  PNPhasingSeries *pfa;
83 
84  if (!pn) XLAL_ERROR(XLAL_EFAULT);
85  if (*pn) XLAL_ERROR(XLAL_EFAULT);
86 
87 
88  pfa = (PNPhasingSeries *) LALMalloc(sizeof(PNPhasingSeries));
89 
90  XLALSimInspiralPNPhasing_F2(pfa, m1, m2, chi1, chi2, chi1*chi1, chi2*chi2, chi1*chi2, p);
91 
92  *pn = pfa;
93 
94  return XLAL_SUCCESS;
95 }
96 
98  REAL8Vector **phasingvals, /**< phasing coefficients (output) */
99  REAL8Vector mass1, /**< Masses of heavier bodies */
100  REAL8Vector mass2, /**< Masses of lighter bodies */
101  REAL8Vector chi1, /**< Aligned spin of body 1 */
102  REAL8Vector chi2, /**< Aligned spin of body 2 */
103  REAL8Vector lambda1, /**< Tidal deformation of body 1 */
104  REAL8Vector lambda2, /**< Tidal deformation of body 2 */
105  REAL8Vector dquadmon1, /**< Self-spin deformation of body 1 */
106  REAL8Vector dquadmon2 /**< Self-spin deformation of body 2 */
107  )
108 {
109  UINT4 idx, jdx;
110  UINT4 pnmaxnum = PN_PHASING_SERIES_MAX_ORDER + 1;
111  LALDict *a=NULL;
112  a=XLALCreateDict();
113 
114  PNPhasingSeries *curr_phasing=NULL;
115  *phasingvals = XLALCreateREAL8Vector(mass1.length * pnmaxnum * 3);
116  REAL8Vector* pv = *phasingvals;
117 
118  for (idx=0; idx < mass1.length; idx++)
119  {
124 
126  (&curr_phasing, mass1.data[idx], mass2.data[idx], chi1.data[idx],
127  chi2.data[idx], a);
128  for (jdx=0; jdx < pnmaxnum; jdx++)
129  {
130  pv->data[jdx*mass1.length + idx] = curr_phasing->v[jdx];
131  pv->data[mass1.length*pnmaxnum + jdx*mass1.length + idx] =
132  curr_phasing->vlogv[jdx];
133  pv->data[mass1.length*pnmaxnum*2 + idx + jdx*mass1.length] =
134  curr_phasing->vlogvsq[jdx];
135  }
136  LALFree(curr_phasing);
137  curr_phasing=NULL;
138  }
139 
141 
142  return XLAL_SUCCESS;
143 }
144 
145 
147  COMPLEX16FrequencySeries **htilde_out, /**< FD waveform */
148  const REAL8Sequence *freqs, /**< frequency points at which to evaluate the waveform (Hz) */
149  const REAL8 phi_ref, /**< reference orbital phase (rad) */
150  const REAL8 m1_SI, /**< mass of companion 1 (kg) */
151  const REAL8 m2_SI, /**< mass of companion 2 (kg) */
152  const REAL8 f_ref, /**< Reference GW frequency (Hz) - if 0 reference point is coalescence */
153  const REAL8 shft, /**< time shift to be applied to frequency-domain phase (sec)*/
154  const REAL8 r, /**< distance of source (m) */
155  LALDict *p, /**< Linked list containing the extra testing GR parameters >*/
156  PNPhasingSeries *pfaP /**< Phasing coefficients >**/
157  )
158 {
159 
160  if (!htilde_out) XLAL_ERROR(XLAL_EFAULT);
161  if (!freqs) XLAL_ERROR(XLAL_EFAULT);
162  /* external: SI; internal: solar masses */
163  const REAL8 m1 = m1_SI / LAL_MSUN_SI;
164  const REAL8 m2 = m2_SI / LAL_MSUN_SI;
165  const REAL8 m = m1 + m2;
166  const REAL8 m_sec = m * LAL_MTSUN_SI; /* total mass in seconds */
167  const REAL8 eta = m1 * m2 / (m * m);
168  const REAL8 piM = LAL_PI * m_sec;
169  REAL8 amp0;
170  size_t i;
171  COMPLEX16 *data = NULL;
172  LIGOTimeGPS tC = {0, 0};
173  INT4 iStart = 0;
174 
175  COMPLEX16FrequencySeries *htilde = NULL;
176 
177  if (*htilde_out) { //case when htilde_out has been allocated in XLALSimInspiralTaylorF2
178  htilde = *htilde_out;
179  iStart = htilde->data->length - freqs->length; //index shift to fill pre-allocated data
180  if(iStart < 0) XLAL_ERROR(XLAL_EFAULT);
181  }
182  else { //otherwise allocate memory here
183  htilde = XLALCreateCOMPLEX16FrequencySeries("htilde: FD waveform", &tC, freqs->data[0], 0., &lalStrainUnit, freqs->length);
184  if (!htilde) XLAL_ERROR(XLAL_EFUNC);
186  }
187 
188  PNPhasingSeries pfa = *pfaP;
189 
190  REAL8 pfaN = 0.; REAL8 pfa1 = 0.;
191  REAL8 pfa2 = 0.; REAL8 pfa3 = 0.; REAL8 pfa4 = 0.;
192  REAL8 pfa5 = 0.; REAL8 pfl5 = 0.;
193  REAL8 pfa6 = 0.; REAL8 pfl6 = 0.;
194  REAL8 pfa7 = 0.;
195 
197  switch (phaseO)
198  {
199  case -1:
200  case 7:
201  pfa7 = pfa.v[7];
202 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
203  __attribute__ ((fallthrough));
204 #endif
205  case 6:
206  pfa6 = pfa.v[6];
207  pfl6 = pfa.vlogv[6];
208 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
209  __attribute__ ((fallthrough));
210 #endif
211  case 5:
212  pfa5 = pfa.v[5];
213  pfl5 = pfa.vlogv[5];
214 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
215  __attribute__ ((fallthrough));
216 #endif
217  case 4:
218  pfa4 = pfa.v[4];
219 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
220  __attribute__ ((fallthrough));
221 #endif
222  case 3:
223  pfa3 = pfa.v[3];
224 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
225  __attribute__ ((fallthrough));
226 #endif
227  case 2:
228  pfa2 = pfa.v[2];
229 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
230  __attribute__ ((fallthrough));
231 #endif
232  case 1:
233  pfa1 = pfa.v[1];
234 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
235  __attribute__ ((fallthrough));
236 #endif
237  case 0:
238  pfaN = pfa.v[0];
239  break;
240  default:
241  XLAL_ERROR(XLAL_ETYPE, "Invalid phase PN order %d", phaseO);
242  }
243 
244  /* Validate expansion order arguments.
245  * This must be done here instead of in the OpenMP parallel loop
246  * because when OpenMP parallelization is turned on, early exits
247  * from loops (via return or break statements) are not permitted.
248  */
249 
250  /* Validate amplitude PN order. */
252  switch (amplitudeO)
253  {
254  case -1:
255  case 7:
256  case 6:
257  case 5:
258  case 4:
259  case 3:
260  case 2:
261  case 0:
262  break;
263  default:
264  XLAL_ERROR(XLAL_ETYPE, "Invalid amplitude PN order %d", amplitudeO);
265  }
266 
267  /* Generate tidal terms separately.
268  * Enums specifying tidal order are in LALSimInspiralWaveformFlags.h
269  */
270  REAL8 pft10 = 0.;
271  REAL8 pft12 = 0.;
272  REAL8 pft13 = 0.;
273  REAL8 pft14 = 0.;
274  REAL8 pft15 = 0.;
276  {
278  pft15 = pfa.v[15];
279 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
280  __attribute__ ((fallthrough));
281 #endif
283 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
284  __attribute__ ((fallthrough));
285 #endif
287  pft14 = pfa.v[14];
288 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
289  __attribute__ ((fallthrough));
290 #endif
292  pft13 = pfa.v[13];
293 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
294  __attribute__ ((fallthrough));
295 #endif
297  pft12 = pfa.v[12];
298 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
299  __attribute__ ((fallthrough));
300 #endif
302  pft10 = pfa.v[10];
303 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
304  __attribute__ ((fallthrough));
305 #endif
307  break;
308  default:
310  }
311 
312  /* The flux and energy coefficients below are used to compute SPA amplitude corrections */
313 
314  /* flux coefficients */
315  const REAL8 FTaN = XLALSimInspiralPNFlux_0PNCoeff(eta);
316  const REAL8 FTa2 = XLALSimInspiralPNFlux_2PNCoeff(eta);
317  const REAL8 FTa3 = XLALSimInspiralPNFlux_3PNCoeff(eta);
318  const REAL8 FTa4 = XLALSimInspiralPNFlux_4PNCoeff(eta);
319  const REAL8 FTa5 = XLALSimInspiralPNFlux_5PNCoeff(eta);
320  const REAL8 FTl6 = XLALSimInspiralPNFlux_6PNLogCoeff(eta);
321  const REAL8 FTa6 = XLALSimInspiralPNFlux_6PNCoeff(eta);
322  const REAL8 FTa7 = XLALSimInspiralPNFlux_7PNCoeff(eta);
323 
324  /* energy coefficients */
325  const REAL8 dETaN = 2. * XLALSimInspiralPNEnergy_0PNCoeff(eta);
326  const REAL8 dETa1 = 2. * XLALSimInspiralPNEnergy_2PNCoeff(eta);
327  const REAL8 dETa2 = 3. * XLALSimInspiralPNEnergy_4PNCoeff(eta);
328  const REAL8 dETa3 = 4. * XLALSimInspiralPNEnergy_6PNCoeff(eta);
329 
330 
331  /* Perform some initial checks */
332  if (m1_SI <= 0) XLAL_ERROR(XLAL_EDOM);
333  if (m2_SI <= 0) XLAL_ERROR(XLAL_EDOM);
334  if (f_ref < 0) XLAL_ERROR(XLAL_EDOM);
335  if (r <= 0) XLAL_ERROR(XLAL_EDOM);
336 
337  /* extrinsic parameters */
338  amp0 = -4. * m1 * m2 / r * LAL_MRSUN_SI * LAL_MTSUN_SI * sqrt(LAL_PI/12.L);
339 
340  data = htilde->data->data;
341 
342  /* Compute the SPA phase at the reference point
343  * N.B. f_ref == 0 means we define the reference time/phase at "coalescence"
344  * when the frequency approaches infinity. In that case,
345  * the integrals Eq. 3.15 of arXiv:0907.0700 vanish when evaluated at
346  * f_ref == infinity. If f_ref is finite, we must compute the SPA phase
347  * evaluated at f_ref, store it as ref_phasing and subtract it off.
348  */
349  REAL8 ref_phasing = 0.;
350  if( f_ref != 0. ) {
351  const REAL8 vref = cbrt(piM*f_ref);
352  const REAL8 logvref = log(vref);
353  const REAL8 v2ref = vref * vref;
354  const REAL8 v3ref = vref * v2ref;
355  const REAL8 v4ref = vref * v3ref;
356  const REAL8 v5ref = vref * v4ref;
357  const REAL8 v6ref = vref * v5ref;
358  const REAL8 v7ref = vref * v6ref;
359  const REAL8 v8ref = vref * v7ref;
360  const REAL8 v9ref = vref * v8ref;
361  const REAL8 v10ref = vref * v9ref;
362  const REAL8 v12ref = v2ref * v10ref;
363  const REAL8 v13ref = vref * v12ref;
364  const REAL8 v14ref = vref * v13ref;
365  const REAL8 v15ref = vref * v14ref;
366  ref_phasing += pfa7 * v7ref;
367  ref_phasing += (pfa6 + pfl6 * logvref) * v6ref;
368  ref_phasing += (pfa5 + pfl5 * logvref) * v5ref;
369  ref_phasing += pfa4 * v4ref;
370  ref_phasing += pfa3 * v3ref;
371  ref_phasing += pfa2 * v2ref;
372  ref_phasing += pfa1 * vref;
373  ref_phasing += pfaN;
374 
375  /* Tidal terms in reference phasing */
376  ref_phasing += pft15 * v15ref;
377  ref_phasing += pft14 * v14ref;
378  ref_phasing += pft13 * v13ref;
379  ref_phasing += pft12 * v12ref;
380  ref_phasing += pft10 * v10ref;
381 
382  ref_phasing /= v5ref;
383  } /* End of if(f_ref != 0) block */
384 
385  #pragma omp parallel for
386  for (i = 0; i < freqs->length; i++) {
387  const REAL8 f = freqs->data[i];
388  const REAL8 v = cbrt(piM*f);
389  const REAL8 logv = log(v);
390  const REAL8 v2 = v * v;
391  const REAL8 v3 = v * v2;
392  const REAL8 v4 = v * v3;
393  const REAL8 v5 = v * v4;
394  const REAL8 v6 = v * v5;
395  const REAL8 v7 = v * v6;
396  const REAL8 v8 = v * v7;
397  const REAL8 v9 = v * v8;
398  const REAL8 v10 = v * v9;
399  const REAL8 v12 = v2 * v10;
400  const REAL8 v13 = v * v12;
401  const REAL8 v14 = v * v13;
402  const REAL8 v15 = v * v14;
403  REAL8 phasing = 0.;
404  REAL8 dEnergy = 0.;
405  REAL8 flux = 0.;
406  REAL8 amp;
407 
408  phasing += pfa7 * v7;
409  phasing += (pfa6 + pfl6 * logv) * v6;
410  phasing += (pfa5 + pfl5 * logv) * v5;
411  phasing += pfa4 * v4;
412  phasing += pfa3 * v3;
413  phasing += pfa2 * v2;
414  phasing += pfa1 * v;
415  phasing += pfaN;
416 
417  /* Tidal terms in phasing */
418  phasing += pft15 * v15;
419  phasing += pft14 * v14;
420  phasing += pft13 * v13;
421  phasing += pft12 * v12;
422  phasing += pft10 * v10;
423 
424  /* WARNING! Amplitude orders beyond 0 have NOT been reviewed!
425  * Use at your own risk. The default is to turn them off.
426  * These do not currently include spin corrections.
427  * Note that these are not higher PN corrections to the amplitude.
428  * They are the corrections to the leading-order amplitude arising
429  * from the stationary phase approximation. See for instance
430  * Eq 6.9 of arXiv:0810.5336
431  */
432  switch (amplitudeO)
433  {
434  case 7:
435  flux += FTa7 * v7;
436 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
437  __attribute__ ((fallthrough));
438 #endif
439  case 6:
440  flux += (FTa6 + FTl6*logv) * v6;
441  dEnergy += dETa3 * v6;
442 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
443  __attribute__ ((fallthrough));
444 #endif
445  case 5:
446  flux += FTa5 * v5;
447 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
448  __attribute__ ((fallthrough));
449 #endif
450  case 4:
451  flux += FTa4 * v4;
452  dEnergy += dETa2 * v4;
453 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
454  __attribute__ ((fallthrough));
455 #endif
456  case 3:
457  flux += FTa3 * v3;
458 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
459  __attribute__ ((fallthrough));
460 #endif
461  case 2:
462  flux += FTa2 * v2;
463  dEnergy += dETa1 * v2;
464 #if __GNUC__ >= 7 && !defined __INTEL_COMPILER
465  __attribute__ ((fallthrough));
466 #endif
467  case -1: /* Default to no SPA amplitude corrections */
468  case 0:
469  flux += 1.;
470  dEnergy += 1.;
471  }
472 
473  phasing /= v5;
474  flux *= FTaN * v10;
475  dEnergy *= dETaN * v;
476  // Note the factor of 2 b/c phi_ref is orbital phase
477  phasing += shft * f - 2.*phi_ref - ref_phasing;
478  amp = amp0 * sqrt(-dEnergy/flux) * v;
479  data[i+iStart] = amp * cos(phasing - LAL_PI_4)
480  - amp * sin(phasing - LAL_PI_4) * 1.0j;
481  }
482 
483  *htilde_out = htilde;
484  return XLAL_SUCCESS;
485 }
486 
487 /**
488  * Computes the stationary phase approximation to the Fourier transform of
489  * a chirp waveform. The amplitude is given by expanding \f$1/\sqrt{\dot{F}}\f$.
490  * If the PN order is set to -1, then the highest implemented order is used.
491  *
492  * @note f_ref is the GW frequency at which phi_ref is defined. The most common
493  * choice in the literature is to choose the reference point as "coalescence",
494  * when the frequency becomes infinite. This is the behavior of the code when
495  * f_ref==0. If f_ref > 0, phi_ref sets the orbital phase at that GW frequency.
496  *
497  * See arXiv:0810.5336 and arXiv:astro-ph/0504538 for spin corrections
498  * to the phasing.
499  * See arXiv:1303.7412 for spin-orbit phasing corrections at 3 and 3.5PN order
500  *
501  * The spin and tidal order enums are defined in LALSimInspiralWaveformFlags.h
502  */
504  COMPLEX16FrequencySeries **htilde_out, /**< FD waveform */
505  const REAL8 phi_ref, /**< reference orbital phase (rad) */
506  const REAL8 deltaF, /**< frequency resolution */
507  const REAL8 m1_SI, /**< mass of companion 1 (kg) */
508  const REAL8 m2_SI, /**< mass of companion 2 (kg) */
509  const REAL8 S1z, /**< z component of the spin of companion 1 */
510  const REAL8 S2z, /**< z component of the spin of companion 2 */
511  const REAL8 fStart, /**< start GW frequency (Hz) */
512  const REAL8 fEnd, /**< highest GW frequency (Hz) of waveform generation - if 0, end at Schwarzschild ISCO */
513  const REAL8 f_ref, /**< Reference GW frequency (Hz) - if 0 reference point is coalescence */
514  const REAL8 r, /**< distance of source (m) */
515  LALDict *p /**< Linked list containing the extra testing GR parameters >**/
516  )
517 {
518  /* external: SI; internal: solar masses */
519  const REAL8 m1 = m1_SI / LAL_MSUN_SI;
520  const REAL8 m2 = m2_SI / LAL_MSUN_SI;
521  const REAL8 m = m1 + m2;
522  const REAL8 m_sec = m * LAL_MTSUN_SI; /* total mass in seconds */
523  // const REAL8 eta = m1 * m2 / (m * m);
524  const REAL8 piM = LAL_PI * m_sec;
525  const REAL8 vISCO = 1. / sqrt(6.);
526  const REAL8 fISCO = vISCO * vISCO * vISCO / piM;
527  //const REAL8 m1OverM = m1 / m;
528  // const REAL8 m2OverM = m2 / m;
529  REAL8 shft, f_max;
530  size_t i, n;
531  INT4 iStart;
532  REAL8Sequence *freqs = NULL;
533  LIGOTimeGPS tC = {0, 0};
534  int ret;
535  int retcode;
536  REAL8 fCONT;
541  XLAL_CHECK(retcode == XLAL_SUCCESS, XLAL_EFUNC, "Failed to set quadparams from Universal relation.\n");
542 
543  COMPLEX16FrequencySeries *htilde = NULL;
544 
545  /* Perform some initial checks */
546  if (!htilde_out) XLAL_ERROR(XLAL_EFAULT);
547  if (*htilde_out) XLAL_ERROR(XLAL_EFAULT);
548  if (m1_SI <= 0) XLAL_ERROR(XLAL_EDOM);
549  if (m2_SI <= 0) XLAL_ERROR(XLAL_EDOM);
550  if (fStart <= 0) XLAL_ERROR(XLAL_EDOM);
551  if (f_ref < 0) XLAL_ERROR(XLAL_EDOM);
552  if (r <= 0) XLAL_ERROR(XLAL_EDOM);
553 
554  /* allocate htilde */
555  if (( fEnd == 0. ) && ( tideO == 0 )) // End at ISCO
556  f_max = fISCO;
557  else if (( fEnd == 0. ) && ( tideO != 0 )) { // End at the minimum of the contact and ISCO frequencies only when tides are enabled
558  fCONT = XLALSimInspiralContactFrequency(m1, lambda1, m2, lambda2); /* Contact frequency of two compact objects */
559  f_max = (fCONT > fISCO) ? fISCO : fCONT;
560  }
561  else // End at user-specified freq.
562  f_max = fEnd;
563  if (f_max <= fStart) XLAL_ERROR(XLAL_EDOM);
564 
565  n = (size_t) (f_max / deltaF + 1);
566  XLALGPSAdd(&tC, -1 / deltaF); /* coalesce at t=0 */
567  htilde = XLALCreateCOMPLEX16FrequencySeries("htilde: FD waveform", &tC, 0.0, deltaF, &lalStrainUnit, n);
568  if (!htilde) XLAL_ERROR(XLAL_EFUNC);
569  memset(htilde->data->data, 0, n * sizeof(COMPLEX16));
571 
572  /* Fill with non-zero vals from fStart to f_max */
573  iStart = (INT4) ceil(fStart / deltaF);
574 
575  /* Sequence of frequencies where waveform model is to be evaluated */
576  freqs = XLALCreateREAL8Sequence(n - iStart);
577 
578  /* extrinsic parameters */
579  shft = LAL_TWOPI * (tC.gpsSeconds + 1e-9 * tC.gpsNanoSeconds);
580 
581  #pragma omp parallel for
582  for (i = iStart; i < n; i++) {
583  freqs->data[i-iStart] = i * deltaF;
584  }
585 
586  /* phasing coefficients */
587  PNPhasingSeries pfa;
588  XLALSimInspiralPNPhasing_F2(&pfa, m1, m2, S1z, S2z, S1z*S1z, S2z*S2z, S1z*S2z, p);
589 
590  ret = XLALSimInspiralTaylorF2Core(&htilde, freqs, phi_ref, m1_SI, m2_SI,
591  f_ref, shft, r, p, &pfa);
592 
594 
595  *htilde_out = htilde;
596 
597  return ret;
598 }
600 
601 /** @} */
602 /** @} */
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
#define LALMalloc(n)
#define LALFree(p)
int XLALSimInspiralSetQuadMonParamsFromLambdas(LALDict *LALparams)
if you do NOT provide a quadparam[1,2] term and you DO provide lamdba[1,2] then we calculate quad-mon...
REAL8 XLALSimInspiralContactFrequency(REAL8 m1_intr, REAL8 barlambda1, REAL8 m2_intr, REAL8 barlambda2)
This function estimates the radius for a binary of given masses and tidal deformability parameters.
static REAL8 UNUSED XLALSimInspiralPNFlux_5PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_0PNCoeff(REAL8 eta)
Computes the flux PN Coefficients.
static REAL8 UNUSED XLALSimInspiralPNFlux_3PNCoeff(REAL8 UNUSED eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_4PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNEnergy_0PNCoeff(REAL8 eta)
Computes the PN Coefficients for using in the PN energy equation.
static REAL8 UNUSED XLALSimInspiralPNFlux_2PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_7PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNCoeff(REAL8 eta)
static REAL8 UNUSED XLALSimInspiralPNFlux_6PNLogCoeff(REAL8 UNUSED eta)
static void UNUSED XLALSimInspiralPNPhasing_F2(PNPhasingSeries *pfa, const REAL8 m1, const REAL8 m2, const REAL8 chi1L, const REAL8 chi2L, const REAL8 chi1sq, const REAL8 chi2sq, const REAL8 chi1dotchi2, LALDict *p)
static REAL8 UNUSED XLALSimInspiralPNEnergy_6PNCoeff(REAL8 eta)
Module to compute the eccentric TaylorF2 inspiral waveform for small eccentricity....
int XLALSimInspiralWaveformParamsInsertTidalLambda1(LALDict *params, REAL8 value)
REAL8 XLALSimInspiralWaveformParamsLookupTidalLambda2(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupTidalLambda1(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNPhaseOrder(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNAmplitudeOrder(LALDict *params)
int XLALSimInspiralWaveformParamsInsertTidalLambda2(LALDict *params, REAL8 value)
INT4 XLALSimInspiralWaveformParamsLookupPNTidalOrder(LALDict *params)
int XLALSimInspiralWaveformParamsInsertdQuadMon2(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertdQuadMon1(LALDict *params, REAL8 value)
double i
Definition: bh_ringdown.c:118
double e
Definition: bh_ringdown.c:117
const double pn
sigmaKerr data[0]
#define __attribute__(x)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
#define LAL_MSUN_SI
#define LAL_PI
#define LAL_TWOPI
#define LAL_MTSUN_SI
#define LAL_PI_4
#define LAL_MRSUN_SI
double complex COMPLEX16
double REAL8
uint32_t UINT4
int32_t INT4
#define LAL_SIM_INSPIRAL_TIDAL_ORDER_DEFAULT
#define PN_PHASING_SERIES_MAX_ORDER
Structure for passing around PN phasing coefficients.
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_5PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_6PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_75PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_7PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_0PN
@ LAL_SIM_INSPIRAL_TIDAL_ORDER_65PN
int XLALSimInspiralTaylorF2Core(COMPLEX16FrequencySeries **htilde_out, const REAL8Sequence *freqs, const REAL8 phi_ref, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 f_ref, const REAL8 shft, const REAL8 r, LALDict *p, PNPhasingSeries *pfaP)
int XLALSimInspiralTaylorF2AlignedPhasingArray(REAL8Vector **phasingvals, REAL8Vector mass1, REAL8Vector mass2, REAL8Vector chi1, REAL8Vector chi2, REAL8Vector lambda1, REAL8Vector lambda2, REAL8Vector dquadmon1, REAL8Vector dquadmon2)
int XLALSimInspiralTaylorF2(COMPLEX16FrequencySeries **htilde_out, const REAL8 phi_ref, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 S1z, const REAL8 S2z, const REAL8 fStart, const REAL8 fEnd, const REAL8 f_ref, const REAL8 r, LALDict *p)
Computes the stationary phase approximation to the Fourier transform of a chirp waveform.
int XLALSimInspiralTaylorF2AlignedPhasing(PNPhasingSeries **pn, const REAL8 m1, const REAL8 m2, const REAL8 chi1, const REAL8 chi2, LALDict *p)
Returns structure containing TaylorF2 phasing coefficients for given physical parameters.
static const INT4 r
static const INT4 m
static const INT4 a
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
const LALUnit lalStrainUnit
const LALUnit lalSecondUnit
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
XLAL_SUCCESS
XLAL_EFAULT
XLAL_EFUNC
XLAL_EDOM
XLAL_ETYPE
XLAL_EINVAL
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
list p
COMPLEX16Sequence * data
COMPLEX16 * data
INT4 gpsNanoSeconds
REAL8 vlogv[PN_PHASING_SERIES_MAX_ORDER+1]
REAL8 vlogvsq[PN_PHASING_SERIES_MAX_ORDER+1]
REAL8 v[PN_PHASING_SERIES_MAX_ORDER+1]
REAL8 * data
double f_max
Definition: unicorn.c:23