Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALSimIMRPhenomD_internals.h
Go to the documentation of this file.
1#ifndef _LALSIM_IMR_PHENOMD_INTERNALS_H
2#define _LALSIM_IMR_PHENOMD_INTERNALS_H
3
4/*
5 * Copyright (C) 2015 Michael Puerrer, Sebastian Khan, Frank Ohme, Ofek Birnholtz, Lionel London, Francesco Pannarale
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with with program; see the file COPYING. If not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 * MA 02110-1301 USA
21 */
22
23/**
24 * \author Michael Puerrer, Sebastian Khan, Frank Ohme, Ofek Birnholtz, Lionel London, Francesco Pannarale
25 *
26 * \file
27 *
28 * \brief Internal function for IMRPhenomD phenomenological waveform model.
29 * See \ref LALSimIMRPhenom_c for more details.
30 *
31 */
32
33/*
34This waveform uses the TaylorF2 coefficients for it's inspiral phase augmented
35by higher order phenomenological terms tuned to SEOBv2-Hybrid waveforms.
36Below are lines copied from LALSimInspiralPNCoefficients.c which are the TaylorF2
37phase coefficients we have used.
38We document them here in case changes to that file changes the behaviour
39of this waveform.
40
41 const REAL8 mtot = m1 + m2;
42 const REAL8 d = (m1 - m2) / (m1 + m2);
43 const REAL8 eta = m1*m2/mtot/mtot;
44 const REAL8 m1M = m1/mtot;
45 const REAL8 m2M = m2/mtot;
46 // Use the spin-orbit variables from arXiv:1303.7412, Eq. 3.9
47 // We write dSigmaL for their (\delta m/m) * \Sigma_\ell
48 // There's a division by mtotal^2 in both the energy and flux terms
49 // We just absorb the division by mtotal^2 into SL and dSigmaL
50
51 const REAL8 SL = m1M*m1M*chi1L + m2M*m2M*chi2L;
52 const REAL8 dSigmaL = d*(m2M*chi2L - m1M*chi1L);
53
54 const REAL8 pfaN = 3.L/(128.L * eta);
55 //Non-spin phasing terms - see arXiv:0907.0700, Eq. 3.18
56 pfa->v[0] = 1.L;
57 pfa->v[2] = 5.L*(743.L/84.L + 11.L * eta)/9.L;
58 pfa->v[3] = -16.L*LAL_PI;
59 pfa->v[4] = 5.L*(3058.673L/7.056L + 5429.L/7.L * eta
60 + 617.L * eta*eta)/72.L;
61 pfa->v[5] = 5.L/9.L * (7729.L/84.L - 13.L * eta) * LAL_PI;
62 pfa->vlogv[5] = 5.L/3.L * (7729.L/84.L - 13.L * eta) * LAL_PI;
63 pfa->v[6] = (11583.231236531L/4.694215680L
64 - 640.L/3.L * LAL_PI * LAL_PI - 6848.L/21.L*LAL_GAMMA)
65 + eta * (-15737.765635L/3.048192L
66 + 2255./12. * LAL_PI * LAL_PI)
67 + eta*eta * 76055.L/1728.L
68 - eta*eta*eta * 127825.L/1296.L;
69 pfa->v[6] += (-6848.L/21.L)*log(4.);
70 pfa->vlogv[6] = -6848.L/21.L;
71 pfa->v[7] = LAL_PI * ( 77096675.L/254016.L
72 + 378515.L/1512.L * eta - 74045.L/756.L * eta*eta);
73
74 // Spin-orbit terms - can be derived from arXiv:1303.7412, Eq. 3.15-16
75 const REAL8 pn_gamma = (554345.L/1134.L + 110.L*eta/9.L)*SL + (13915.L/84.L - 10.L*eta/3.)*dSigmaL;
76 switch( spinO )
77 {
78 case LAL_SIM_INSPIRAL_SPIN_ORDER_ALL:
79 case LAL_SIM_INSPIRAL_SPIN_ORDER_35PN:
80 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;
81*/
82
83
84#include <stdlib.h>
85#include <stdio.h>
86#include <math.h>
87#include <complex.h>
88#include <gsl/gsl_errno.h>
89#include <gsl/gsl_spline.h>
90
91#include <lal/LALStdlib.h>
92#include <lal/LALSimIMR.h>
93#include <lal/LALConstants.h>
94#include <lal/Date.h>
95#include <lal/FrequencySeries.h>
96#include <lal/Units.h>
97#include <lal/LALSimInspiral.h>
98
99#include "LALSimIMRPhenomD.h"
100
101//PI^(-1/6) [http://oeis.org/A093207]
102#define PI_M_SIXTH 0.8263074871107581108331125856317241299
103
104// NOTE: At the moment we have separate functions for each Phenom coefficient;
105// these could be collected together
106
107/**
108 * Structure holding all coefficients for the amplitude
109 */
110typedef struct tagIMRPhenomDAmplitudeCoefficients {
111 double eta; // symmetric mass-ratio
112 double etaInv; // 1/eta
113 double chi12; // chi1*chi1;
114 double chi22; // chi2*chi2;
115 double eta2; // eta*eta;
116 double eta3; // eta*eta*eta;
117 double Seta; // sqrt(1.0 - 4.0*eta);
118 double SetaPlus1; // (1.0 + Seta);
119 double chi1, chi2; // dimensionless aligned spins, convention m1 >= m2.
120 double q; // asymmetric mass-ratio (q>=1)
121 double chi; // PN reduced spin parameter
122 double fRD; // ringdown frequency
123 double fDM; // imaginary part of the ringdown frequency (damping time)
124
125 double fmaxCalc; // frequency at which the mrerger-ringdown amplitude is maximum
126
127 // Phenomenological inspiral amplitude coefficients
128 double rho1;
129 double rho2;
130 double rho3;
131
132 // Phenomenological intermediate amplitude coefficients
133 double delta0;
134 double delta1;
135 double delta2;
136 double delta3;
137 double delta4;
138
139 // Phenomenological merger-ringdown amplitude coefficients
140 double gamma1;
141 double gamma2;
142 double gamma3;
143
144 // Coefficients for collocation method. Used in intermediate amplitude model
145 double f1, f2, f3;
146 double v1, v2, v3;
147 double d1, d2;
148
149 // Transition frequencies for amplitude
150 // We don't *have* to store them, but it may be clearer.
151 double fInsJoin; // Ins = Inspiral
152 double fMRDJoin; // MRD = Merger-Ringdown
153}
155
156/**
157 * Structure holding all coefficients for the phase
158 */
159typedef struct tagIMRPhenomDPhaseCoefficients {
160 double eta; // symmetric mass-ratio
161 double etaInv; // 1/eta
162 double eta2; // eta*eta
163 double Seta; // sqrt(1.0 - 4.0*eta);
164 double chi1, chi2; // dimensionless aligned spins, convention m1 >= m2.
165 double q; // asymmetric mass-ratio (q>=1)
166 double chi; // PN reduced spin parameter
167 double fRD; // ringdown frequency
168 double fDM; // imaginary part of the ringdown frequency (damping time)
169
170 // Phenomenological inspiral phase coefficients
171 double sigma1;
172 double sigma2;
173 double sigma3;
174 double sigma4;
175 double sigma5;
176
177 // Phenomenological intermediate phase coefficients
178 double beta1;
179 double beta2;
180 double beta3;
181
182 // Phenomenological merger-ringdown phase coefficients
183 double alpha1;
184 double alpha2;
185 double alpha3;
186 double alpha4;
187 double alpha5;
188
189 // C1 phase connection coefficients
190 double C1Int;
191 double C2Int;
192 double C1MRD;
193 double C2MRD;
194
195 // Transition frequencies for phase
196 double fInsJoin; // Ins = Inspiral
197 double fMRDJoin; // MRD = Merger-Ringdown
198}
200
201
202 /**
203 * Structure holding all additional coefficients needed for the delta amplitude functions.
204 */
205typedef struct tagdeltaUtility {
206 double f12;
207 double f13;
208 double f14;
209 double f15;
210 double f22;
211 double f23;
212 double f24;
213 double f32;
214 double f33;
215 double f34;
216 double f35;
218
219/*
220 *
221 * Internal function prototypes; f stands for geometric frequency "Mf"
222 *
223 */
224
225////////////////////////////// Miscellaneous functions //////////////////////////////
226
227static double chiPN(double Seta, double eta, double chi1, double chi2);
228UNUSED static size_t NextPow2(const size_t n);
229// static double StepFunc(const double t, const double t1);
230static bool StepFunc_boolean(const double t, const double t1);
231
232static inline double pow_2_of(double number);
233static inline double pow_3_of(double number);
234static inline double pow_4_of(double number);
235
236UNUSED static double Subtract3PNSS(double m1, double m2, double M, double eta, double chi1, double chi2);
237
238/******************************* Constants to save floating-point pow calculations *******************************/
239
240/**
241 * 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, -1/3, -2/3, -5/3
242 * calculated using only one invocation of 'pow', the rest are just multiplications and divisions
243 */
244typedef struct tagUsefulPowers
245{
246 //REAL8 sixth; //FP
255 //REAL8 m_sixth; //FP
261
262/**
263 * must be called before the first usage of *p
264 */
265static int init_useful_powers(UsefulPowers * p, REAL8 number);
266
267/**
268 * useful powers of LAL_PI, calculated once and kept constant - to be initied with a call to
269 * init_useful_powers(&powers_of_pi, LAL_PI);
270 *
271 * only declared here, defined in LALSIMIMRPhenomD.c (because this c file is "included" like an h file)
272 */
274
275/**
276 * used to cache the recurring (frequency-independent) prefactors of AmpInsAnsatz. Must be inited with a call to
277 * init_amp_ins_prefactors(&prefactors, p);
278 */
279typedef struct tagAmpInsPrefactors
280{
282 double one;
285 double two;
288 double three;
289
290 double amp0;
292
293/**
294 * must be called before the first usage of *prefactors
295 */
297
298/**
299 * used to cache the recurring (frequency-independent) prefactors of PhiInsAnsatzInt. Must be inited with a call to
300 * init_phi_ins_prefactors(&prefactors, p, pn);
301 */
302typedef struct tagPhiInsPrefactors
303{
305 double third;
308 double one;
311 double two;
312 double logv;
315 double minus_one;
319
320/**
321 * must be called before the first usage of *prefactors
322 */
324
325
326/******************************* integer powers floating-point pow calculations *******************************/
327
328/**
329 * calc square of number without floating point 'pow'
330 */
331static inline double pow_2_of(double number)
332{
333 return (number*number);
334}
335
336/**
337 * calc cube of number without floating point 'pow'
338 */
339static inline double pow_3_of(double number)
340{
341 return (number*number*number);
342}
343
344/**
345 * calc fourth power of number without floating point 'pow'
346 */
347static inline double pow_4_of(double number)
348{
349 double pow2 = pow_2_of(number);
350 return pow2 * pow2;
351}
352
353//////////////////////// Final spin, final mass, fring, fdamp ///////////////////////
354
355static double FinalSpin0815_s(double eta, double s);
356UNUSED static double FinalSpin0815(double eta, double chi1, double chi2);
357static double fring(double eta, double chi1, double chi2, double finalspin);
358static double fdamp(double eta, double chi1, double chi2, double finalspin);
359
360/******************************* Amplitude functions *******************************/
361
362static double amp0Func(double eta);
363
364///////////////////////////// Amplitude: Inspiral functions /////////////////////////
365
366static double rho1_fun(double eta, double eta2, double xi);
367static double rho2_fun(double eta, double eta2, double xi);
368static double rho3_fun(double eta, double eta2, double xi);
369static double AmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, AmpInsPrefactors * prefactors);
370static double DAmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, IMRPhenomDAmplitudeCoefficients* p);
371
372////////////////////////// Amplitude: Merger-Ringdown functions //////////////////////
373
374static double gamma1_fun(double eta, double eta2, double xi);
375static double gamma2_fun(double eta, double eta2, double xi);
376static double gamma3_fun(double eta, double eta2, double xi);
380
381//////////////////////////// Amplitude: Intermediate functions ///////////////////////
382
384static double AmpIntColFitCoeff(double eta, double eta2, double chiPN); //this is the v2 value
391
392///////////////////////////// Amplitude: glueing function ////////////////////////////
393
394UNUSED static void ComputeIMRPhenomDAmplitudeCoefficients(IMRPhenomDAmplitudeCoefficients *p, double eta, double chi1, double chi2, double finspin);
395UNUSED static double IMRPhenDAmplitude(double f, IMRPhenomDAmplitudeCoefficients *p, UsefulPowers *powers_of_f, AmpInsPrefactors *prefactors);
396
397/********************************* Phase functions *********************************/
398
399/////////////////////////////// Phase: Ringdown functions ////////////////////////////
400
401static double alpha1Fit(double eta, double eta2, double xi);
402static double alpha2Fit(double eta, double eta2, double xi);
403static double alpha3Fit(double eta, double eta2, double xi);
404static double alpha4Fit(double eta, double eta2, double xi);
405static double alpha5Fit(double eta, double eta2, double xi);
406static double PhiMRDAnsatzInt(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm);
407static double DPhiMRD(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm);
408
409/////////////////////////// Phase: Intermediate functions ///////////////////////////
410
411static double beta1Fit(double eta, double eta2, double xi);
412static double beta2Fit(double eta, double eta2, double xi);
413static double beta3Fit(double eta, double eta2, double xi);
414static double PhiIntAnsatz(double f, IMRPhenomDPhaseCoefficients *p);
415static double DPhiIntAnsatz(double f, IMRPhenomDPhaseCoefficients *p);
416static double DPhiIntTemp(double ff, IMRPhenomDPhaseCoefficients *p);
417
418///////////////////////////// Phase: Inspiral functions /////////////////////////////
419
420static double sigma1Fit(double eta, double eta2, double xi);
421static double sigma2Fit(double eta, double eta2, double xi);
422static double sigma3Fit(double eta, double eta2, double xi);
423static double sigma4Fit(double eta, double eta2, double xi);
424static double PhiInsAnsatzInt(double f, UsefulPowers *powers_of_Mf, PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn);
426
427////////////////////////////// Phase: glueing function //////////////////////////////
428
429UNUSED static void ComputeIMRPhenomDPhaseCoefficients(IMRPhenomDPhaseCoefficients *p, double eta, double chi1, double chi2, double finspin, LALDict *extraParams);
430UNUSED static void ComputeIMRPhenDPhaseConnectionCoefficients(IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, PhiInsPrefactors *prefactors, double Rholm, double Taulm);
431UNUSED static double IMRPhenDPhase(double f, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, UsefulPowers *powers_of_f, PhiInsPrefactors *prefactors, double Rholm, double Taulm);
432
433/* Non-reviewd functions using written for PhenomHM */
434
435/**
436 * A struct the store the amplitude and phase structs for phenomD
437 */
438typedef struct tagPhenDAmpAndPhasePreComp
439{
446
447/**
448 * Function to populate the PhenDAmpAndPhasePreComp struct
449 * with quantities that can be computed outside a frequency loop
450 * when you want to generate the PhenomD amplitude and phase.
451 */
453 PhenDAmpAndPhasePreComp *pDPreComp,
454 REAL8 m1,
455 REAL8 m2,
456 REAL8 chi1x,
457 REAL8 chi1y,
458 REAL8 chi1z,
459 REAL8 chi2x,
460 REAL8 chi2y,
461 REAL8 chi2z,
462 const REAL8 Rholm,
463 const REAL8 Taulm,
464 LALDict *extraParams);
465
467 REAL8 Mf,
469 REAL8 Rholm,
470 REAL8 Taulm);
471#endif // of #ifndef _LALSIM_IMR_PHENOMD_INTERNALS_H
Tabulated Quasi-Normal Mode Information for Ringdown.
static double sigma1Fit(double eta, double eta2, double xi)
UNUSED int IMRPhenomDSetupAmpAndPhaseCoefficients(PhenDAmpAndPhasePreComp *pDPreComp, REAL8 m1, REAL8 m2, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, const REAL8 Rholm, const REAL8 Taulm, LALDict *extraParams)
Function to populate the PhenDAmpAndPhasePreComp struct with quantities that can be computed outside ...
static double beta2Fit(double eta, double eta2, double xi)
static UNUSED double Subtract3PNSS(double m1, double m2, double M, double eta, double chi1, double chi2)
static double PhiMRDAnsatzInt(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm)
static double DAmpMRDAnsatz(double f, IMRPhenomDAmplitudeCoefficients *p)
static UNUSED double FinalSpin0815(double eta, double chi1, double chi2)
static double alpha2Fit(double eta, double eta2, double xi)
static double DAmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, IMRPhenomDAmplitudeCoefficients *p)
static double fdamp(double eta, double chi1, double chi2, double finalspin)
static double delta4_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double AmpIntColFitCoeff(double eta, double eta2, double chiPN)
static double amp0Func(double eta)
static double DPhiIntAnsatz(double f, IMRPhenomDPhaseCoefficients *p)
UNUSED REAL8 IMRPhenomDPhase_OneFrequency(REAL8 Mf, PhenDAmpAndPhasePreComp pD, REAL8 Rholm, REAL8 Taulm)
Function to return the phenomD phase using the IMRPhenomDSetupAmpAndPhaseCoefficients struct.
static double alpha1Fit(double eta, double eta2, double xi)
static UNUSED double IMRPhenDAmplitude(double f, IMRPhenomDAmplitudeCoefficients *p, UsefulPowers *powers_of_f, AmpInsPrefactors *prefactors)
static double sigma3Fit(double eta, double eta2, double xi)
static UNUSED void ComputeIMRPhenomDPhaseCoefficients(IMRPhenomDPhaseCoefficients *p, double eta, double chi1, double chi2, double finspin, LALDict *extraParams)
static double PhiIntAnsatz(double f, IMRPhenomDPhaseCoefficients *p)
static double beta3Fit(double eta, double eta2, double xi)
static double rho2_fun(double eta, double eta2, double xi)
static double AmpMRDAnsatz(double f, IMRPhenomDAmplitudeCoefficients *p)
static double beta1Fit(double eta, double eta2, double xi)
static double PhiInsAnsatzInt(double f, UsefulPowers *powers_of_Mf, PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
static UNUSED void ComputeIMRPhenDPhaseConnectionCoefficients(IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
static double rho1_fun(double eta, double eta2, double xi)
static double delta2_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double alpha3Fit(double eta, double eta2, double xi)
static double fmaxCalc(IMRPhenomDAmplitudeCoefficients *p)
static double chiPN(double Seta, double eta, double chi1, double chi2)
static double pow_3_of(double number)
calc cube of number without floating point 'pow'
static double gamma2_fun(double eta, double eta2, double xi)
static double AmpInsAnsatz(double Mf, UsefulPowers *powers_of_Mf, AmpInsPrefactors *prefactors)
static double alpha5Fit(double eta, double eta2, double xi)
static double delta3_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double sigma2Fit(double eta, double eta2, double xi)
static double AmpIntAnsatz(double f, IMRPhenomDAmplitudeCoefficients *p)
static UNUSED int init_phi_ins_prefactors(PhiInsPrefactors *prefactors, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
must be called before the first usage of *prefactors
static double FinalSpin0815_s(double eta, double s)
static void ComputeDeltasFromCollocation(IMRPhenomDAmplitudeCoefficients *p)
static double delta1_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static double gamma1_fun(double eta, double eta2, double xi)
static double pow_4_of(double number)
calc fourth power of number without floating point 'pow'
UsefulPowers powers_of_pi
useful powers of LAL_PI, calculated once and kept constant - to be initied with a call to init_useful...
static double alpha4Fit(double eta, double eta2, double xi)
static double rho3_fun(double eta, double eta2, double xi)
static double delta0_fun(IMRPhenomDAmplitudeCoefficients *p, DeltaUtility *d)
static UNUSED double IMRPhenDPhase(double f, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn, UsefulPowers *powers_of_f, PhiInsPrefactors *prefactors, double Rholm, double Taulm)
static double sigma4Fit(double eta, double eta2, double xi)
static double fring(double eta, double chi1, double chi2, double finalspin)
static double DPhiIntTemp(double ff, IMRPhenomDPhaseCoefficients *p)
static bool StepFunc_boolean(const double t, const double t1)
static double pow_2_of(double number)
calc square of number without floating point 'pow'
static int init_amp_ins_prefactors(AmpInsPrefactors *prefactors, IMRPhenomDAmplitudeCoefficients *p)
must be called before the first usage of *prefactors
static UNUSED size_t NextPow2(const size_t n)
static double gamma3_fun(double eta, double eta2, double xi)
static UNUSED void ComputeIMRPhenomDAmplitudeCoefficients(IMRPhenomDAmplitudeCoefficients *p, double eta, double chi1, double chi2, double finspin)
static double DPhiMRD(double f, IMRPhenomDPhaseCoefficients *p, double Rholm, double Taulm)
static int init_useful_powers(UsefulPowers *p, REAL8 number)
must be called before the first usage of *p
static double DPhiInsAnsatzInt(double ff, IMRPhenomDPhaseCoefficients *p, PNPhasingSeries *pn)
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 ...
int s
Definition: bh_qnmode.c:137
REAL8 M
Definition: bh_qnmode.c:133
const double pn
double REAL8
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.
A struct the store the amplitude and phase structs for phenomD.
IMRPhenomDPhaseCoefficients pPhi
IMRPhenomDAmplitudeCoefficients pAmp
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,...