LALSimulation  5.4.0.1-fe68b98
LALSimInspiralEOBPAAuxiliaryFuncs.c
Go to the documentation of this file.
1 #include <lal/LALSimIMR.h>
2 #include <lal/LALSimInspiral.h>
3 #include <lal/Date.h>
4 #include <lal/TimeSeries.h>
5 #include <lal/Units.h>
6 #include <lal/LALAdaptiveRungeKuttaIntegrator.h>
7 #include <lal/SphericalHarmonics.h>
8 #include <lal/LALSimSphHarmMode.h>
10 #include <lal/LALDict.h>
11 
12 #include <gsl/gsl_sf_gamma.h>
13 #include <gsl/gsl_matrix.h>
14 #include <gsl/gsl_poly.h>
15 #include <gsl/gsl_spline.h>
16 #include <gsl/gsl_roots.h>
17 #include <gsl/gsl_deriv.h>
18 
20 
23 
25 
26 /**
27  * Function which calculates the mass ratio q from the masses m1 and m2
28  */
29 REAL8
31  const REAL8 m1,
32  /**<< Mass of the primary */
33  const REAL8 m2
34  /**<< Mass of the secondary */
35 )
36 {
37  REAL8 q;
38 
39  q = m1 / m2;
40 
41  if (q > 1.)
42  {
43  q = m2 / m1;
44  }
45 
46  return q;
47 }
48 
49 /**
50  * Function which calculates the symmetric mass ratio nu from the mass
51  * ratio q
52  */
53 REAL8
55  const REAL8 q
56  /**<< Mass ratio */
57 )
58 {
59  REAL8 nu = 0.;
60 
61  if (q > 0.)
62  {
63  nu = q / ((q+1.)*(q+1.));
64  }
65 
66  return nu;
67 }
68 
69 /**
70  * Function which calculates the parameter X1 from the symmetric mass
71  * ratio nu
72  */
73 REAL8
75  REAL8 nu
76  /**<< Symmetric mass ratio */
77 )
78 {
79  if (nu > 0.25 && fabs(nu - 0.25) < 1e-4) {
80  nu = 0.25;
81  }
82 
83  if ( (nu < 0.) || (nu > 0.25) )
84  {
86  "XLAL Error - %s: Symmetric mass ratio is 0 <= nu <= 1/4.\n",
87  __func__
88  );
90  }
91 
92  REAL8 X1 = 0.5 * (1. + sqrt(1. - 4. * nu));
93 
94  return X1;
95 }
96 
97 /**
98  * Function which calculates the parameter X2 from the symmetric mass
99  * ratio nu
100  */
101 REAL8
103  const REAL8 nu
104  /**<< Symmetric mass ratio */
105 )
106 {
108 
109  REAL8 X2 = 1. - X1;
110 
111  return X2;
112 }
113 
114 /**
115  * Function which calculates the spin parameter a
116  */
117 REAL8
119  REAL8 X,
120  /**<< Parameter X for the binary component */
121  REAL8 chi
122  /**<< Spin of the binary component */
123 )
124 {
125  REAL8 a;
126  a = X * X * chi;
127 
128  return a;
129 }
130 
131 /**
132  * Function which calculates the spin parameter Sstar (S*)
133  */
134 REAL8
136  REAL8 X1,
137  /**<< Parameter X1 */
138  REAL8 X2,
139  /**<< Parameter X2 */
140  REAL8 chi1,
141  /**<< Spin of the primary component */
142  REAL8 chi2
143  /**<< Spin of the secondary component */
144 )
145 {
146  REAL8 Sstar;
147  Sstar = X1 * X2 * (chi1+chi2);
148 
149  return Sstar;
150 }
151 
152 /**
153  * Function which calculates the frequency Omega
154  */
155 REAL8
157  REAL8 polarDynamics[],
158  /**<< The polar coordinates of a point along the binary inspiral */
159  REAL8 dr,
160  /**<< The spacing of the radial grid */
161  SpinEOBParams *seobParams,
162  /**<< Struct of additional parameters */
163  LALDict *LALParams
164  /**<< Pointer to a dictionary containing additional */
165 )
166 {
167  const UINT2 analyticFlag = XLALDictLookupUINT2Value(
168  LALParams, "analyticFlag"
169  );
170 
171  REAL8 omega;
172 
173  if (analyticFlag == 0)
174  {
176  polarDynamics,
177  seobParams,
178  dr
179  );
180  }
181  else
182  {
184  polarDynamics,
185  seobParams
186  );
187  }
188 
189  return omega;
190 }
191 
192 /**
193  * Function which calculates the final radius at which the post-adiabatic
194  * routine stops
195  */
196 REAL8
198  REAL8 a
199  /**<< Spin parameter a */
200 )
201 {
202 
203  REAL8 rISCO;
204  REAL8 finalRadiusPrefactor;
205  REAL8 rFinal;
206 
207 
208  rISCO = XLALSimRadiusKerrISCO(a);
209  finalRadiusPrefactor = 1.0;
210 
211  rFinal = finalRadiusPrefactor * rISCO;
212 
213  return rFinal;
214 }
215 
216 /**
217  * Function which calculates the spacing of the radial grid
218  */
219 REAL8
221  REAL8 rStart,
222  /**<< The starting radius */
223  REAL8 rFinal,
224  /**<< The final radius */
225  UINT4 rSize
226  /**<< The number of points along the post-adiabatic inspiral */
227 )
228 {
229  REAL8 dr;
230 
231  dr = (rStart-rFinal) / (rSize-1);
232 
233  return dr;
234 }
235 
236 /**
237  * Function which calculates the circular angular momentum j0
238  */
239 REAL8
241  REAL8 r
242  /**<< Value of the radius */
243 )
244 {
245  REAL8 Newtonianj0;
246  Newtonianj0 = sqrt(r);
247 
248  return Newtonianj0;
249 }
UINT2 XLALDictLookupUINT2Value(LALDict *dict, const char *key)
static REAL8 XLALSimIMRSpinAlignedEOBCalcOmega(const REAL8 values[], SpinEOBParams *funcParams, REAL8 STEP_SIZE)
Function to calculate the value of omega for the spin-aligned EOB waveform.
static REAL8 XLALSimIMRSpinAlignedEOBCalcOmegaOptimized(const REAL8 values[], SpinEOBParams *funcParams)
Function to calculate the value of omega for the spin-aligned EOB waveform.
REAL8 XLALSimInspiralEOBPACalculateMassRatio(const REAL8 m1, const REAL8 m2)
Function which calculates the mass ratio q from the masses m1 and m2.
REAL8 XLALSimInspiralEOBPACalculatea(REAL8 X, REAL8 chi)
Function which calculates the spin parameter a.
REAL8 XLALSimIMRSpinAlignedEOBPACalculateOmega(REAL8 polarDynamics[], REAL8 dr, SpinEOBParams *seobParams, LALDict *LALParams)
Function which calculates the frequency Omega.
REAL8 XLALSimInspiralEOBPACalculatedr(REAL8 rStart, REAL8 rFinal, UINT4 rSize)
Function which calculates the spacing of the radial grid.
REAL8 XLALSimInspiralEOBPACalculateSymmetricMassRatio(const REAL8 q)
Function which calculates the symmetric mass ratio nu from the mass ratio q.
REAL8 XLALSimInspiralEOBPACalculateSstar(REAL8 X1, REAL8 X2, REAL8 chi1, REAL8 chi2)
Function which calculates the spin parameter Sstar (S*)
REAL8 XLALSimInspiralEOBPostAdiabaticFinalRadiusAlternative(REAL8 a)
Function which calculates the final radius at which the post-adiabatic routine stops.
REAL8 XLALSimInspiralEOBPACalculateNewtonianj0(REAL8 r)
Function which calculates the circular angular momentum j0.
REAL8 XLALSimInspiralEOBPACalculateX2(const REAL8 nu)
Function which calculates the parameter X2 from the symmetric mass ratio nu.
REAL8 XLALSimInspiralEOBPACalculateX1(REAL8 nu)
Function which calculates the parameter X1 from the symmetric mass ratio nu.
double e
Definition: bh_ringdown.c:117
double REAL8
uint16_t UINT2
uint32_t UINT4
REAL8 XLALSimRadiusKerrISCO(REAL8 a)
static const INT4 r
static const INT4 q
static const INT4 a
#define XLAL_ERROR(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_EINVAL
Parameters for the spinning EOB model.