LALSimulation  5.4.0.1-fe68b98
LALSimIMRSpinEOBFactorizedFlux_PA.c
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2010 Craig Robinson, Yi Pan, Prayush Kumar (minor changes)
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 /**
22  * \author Craig Robinson, Yi Pan
23  *
24  * \brief Function to compute the factorized flux as uses in the SEOBNRv1
25  * model. Flux function given in
26  * Taracchini et al. ( PRD 86, 024011 (2012), arXiv 1202.0790 ).
27  * All equation numbers in this file refer to equations of this paper,
28  * unless otherwise specified.
29  */
30 
31 #ifndef _LALSIMIMRSPINEOBFACTORIZEDFLUX_C
32 #define _LALSIMIMRSPINEOBFACTORIZEDFLUX_C
33 
34 #include <complex.h>
35 #include <lal/LALSimInspiral.h>
36 #include <lal/LALSimIMR.h>
37 
38 #include "LALSimIMREOBNRv2.h"
39 #include "LALSimIMRSpinEOB.h"
40 
44 
45 
46 UNUSED static int UsePrec = 0;
47 
48 /*------------------------------------------------------------------------------------------
49  *
50  * Prototypes of functions defined in this code.
51  *
52  *------------------------------------------------------------------------------------------
53  */
54 
56  EOBNonQCCoeffs * nqcCoeffs,
57  const REAL8 omega,
58  SpinEOBParams * ak,
59  const REAL8 H,
60  const UINT4 lMax,
61  const UINT4
62  SpinAlignedEOBversion);
63 
64 /*------------------------------------------------------------------------------------------
65  *
66  * Defintions of functions.
67  *
68  *------------------------------------------------------------------------------------------
69  */
70 
71 /**
72  * This function calculates the spin factorized-resummed GW energy flux
73  * for given dynamical variables.
74  */
75 
76 static REAL8
77 XLALInspiralSpinFactorizedFlux_PA (REAL8Vector * values, /**< dynamical variables */
78  EOBNonQCCoeffs * nqcCoeffs,
79  /**< pre-computed NQC coefficients */
80  const REAL8 omega, /**< orbital frequency */
81  SpinEOBParams * ak, /**< physical parameters */
82  const REAL8 H, /**< real Hamiltonian */
83  const UINT4 lMax, /**< upper limit of the summation over l */
84  UNUSED const UINT4 SpinAlignedEOBversion /**< 1 for SEOBNRv1, 2 for SEOBNRv2, 4 for SEOBNRv4 */
85  )
86 {
87  if ( nqcCoeffs==NULL ) {
89  }
90  REAL8 flux = 0.0;
91  REAL8 v;
92  REAL8 omegaSq;
93  COMPLEX16 hLM;
94  INT4 l, m;
95 
96  //EOBNonQCCoeffs nqcCoeffs;
97 
98 #ifndef LAL_NDEBUG
99  if (!values || !ak)
100  {
102  }
103 #endif
104 
105  if (lMax < 2)
106  {
108  }
109 
110  /* Omegs is the derivative of phi */
111  omegaSq = omega * omega;
112 
113  v = cbrt (omega);
115  COMPLEX16 hT= 0.;
116 // printf( "v = %.16e\n", v );
117  for (l = 2; l <= (INT4) lMax; l++)
118  {
119  for (m = 1; m <= l; m++)
120  {
121  INT4 use_optimized_v2 = 1;
122  if ( (ak->seobCoeffs->tidal1->lambda2Tidal != 0. && ak->seobCoeffs->tidal1->omega02Tidal != 0.) || (ak->seobCoeffs->tidal2->lambda2Tidal != 0. && ak->seobCoeffs->tidal2->omega02Tidal != 0.) ) {
124  (&hLM, values, v, H, l, m, ak, use_optimized_v2
125  ) == XLAL_FAILURE)
126  {
128  }
130  (&hT, values, v, l, m, ak
131  ) == XLAL_FAILURE)
132  {
134  }
135  }
136  else {
138  (&hLM, values, v, H, l, m, ak, use_optimized_v2,
139  &vPhi) == XLAL_FAILURE)
140  {
142  }
143  }
144 
145  /* For the 2,2 mode, we apply NQC correction to the flux */
146  if (l == 2 && m == 2)
147  {
148  COMPLEX16 hNQC;
149  XLALSimIMREOBNonQCCorrection (&hNQC, values, omega, nqcCoeffs);
150  /* Eq. 16 */
151  hLM *= hNQC;
152  }
153  hLM += hT;
154 
155  //printf( "l = %d, m = %d, mag(hLM) = %.17e, omega = %.16e\n", l, m, sqrt(creal(hLM)*creal(hLM)+cimag(hLM)*cimag(hLM)), omega );
156  /* Eq. 13 */
157  flux +=
158  (REAL8) (m * m) * omegaSq * (creal (hLM) * creal (hLM) +
159  cimag (hLM) * cimag (hLM));
160  }
161  }
162  return flux * LAL_1_PI / 8.0;
163 }
164 
165 #endif /* _LALSIMIMRSPINEOBFACTORIZEDFLUX_C */
static UNUSED int XLALSimIMREOBNonQCCorrection(COMPLEX16 *restrict nqc, REAL8Vector *restrict values, const REAL8 omega, EOBNonQCCoeffs *restrict coeffs)
This function calculates the non-quasicircular correction to apply to the waveform.
static REAL8 XLALInspiralSpinFactorizedFlux_PA(REAL8Vector *values, EOBNonQCCoeffs *nqcCoeffs, const REAL8 omega, SpinEOBParams *ak, const REAL8 H, const UINT4 lMax, const UINT4 SpinAlignedEOBversion)
static UNUSED int UsePrec
static INT4 XLALSimIMRSpinEOBWaveformTidal(COMPLEX16 *restrict hlm, REAL8Vector *restrict values, const REAL8 v, const INT4 l, const INT4 m, SpinEOBParams *restrict params)
This function calculates tidal correction to the hlm mode factorized-resummed waveform for given dyna...
static INT4 XLALSimIMRSpinEOBFluxGetSpinFactorizedWaveform(COMPLEX16 *restrict hlm, REAL8Vector *restrict values, const REAL8 v, const REAL8 Hreal, const INT4 l, const INT4 m, SpinEOBParams *restrict params, INT4 use_optimized_v2, REAL8 *vPhil2m2)
This function calculates hlm mode factorized-resummed waveform for given dynamical variables.
static UNUSED INT4 XLALSimIMRSpinEOBGetSpinFactorizedWaveform(COMPLEX16 *restrict hlm, REAL8Vector *restrict values, const REAL8 v, const REAL8 Hreal, const INT4 l, const INT4 m, SpinEOBParams *restrict params, INT4 use_optimized_v2)
This function calculates hlm mode factorized-resummed waveform for given dynamical variables.
static REAL8 XLALSimIMRSpinAlignedEOBNonKeplerCoeffOptimized(const REAL8 values[], SpinEOBParams *funcParams)
Function to calculate the non-Keplerian coefficient for the spin-aligned EOB model.
int l
Definition: bh_qnmode.c:135
const double H
#define LAL_1_PI
double complex COMPLEX16
double REAL8
uint32_t UINT4
int32_t INT4
static const INT4 m
#define XLAL_ERROR_REAL8(...)
XLAL_EFAULT
XLAL_EFUNC
XLAL_EINVAL
XLAL_FAILURE
The coefficients which are used in calculating the non-quasicircular correction to the EOBNRv2 model.
REAL8 * data
TidalEOBParams * tidal1
TidalEOBParams * tidal2
Parameters for the spinning EOB model.
SpinEOBHCoeffs * seobCoeffs