27#include <lal/LALAdaptiveRungeKuttaIntegrator.h>
28#include <lal/LALConstants.h>
29#include <lal/FindRoot.h>
30#include <lal/SeqFactories.h>
31#include <lal/LALSimInspiral.h>
32#include <lal/LALSimIMR.h>
34#include <lal/LALSimNoise.h>
35#include <lal/ComplexFFT.h>
37#include <lal/ComplexFFT.h>
38#include <gsl/gsl_errno.h>
39#include <gsl/gsl_spline.h>
40#include <gsl/gsl_math.h>
42#define MYUNUSED(expr) do { (void)(expr); } while (0)
47 return fabs(b) < epsilon;
49 return fabs(
a) < epsilon;
51 return !gsl_fcmp(
a, b, epsilon);
56 printf(
"%s: %-20.17g\t%-20.17g\t%-20.17g\n",
name,
u, u_expected,
u - u_expected);
59#define COUNT_FGWINKERR 9
60#define TOLERANCE_FGWINKERR 1e-8
62 {8.7173522796064891, 1.0, -0.900}, {13.0760284194097345, 1.0, -0.900},
63 {17.4347045592129781, 1.0, -0.900}, {6.0000000000000000, 1.0, 0.000},
64 {9.0000000000000000, 1.0, 0.000}, {12.0000000000000000, 1.0, 0.000},
65 {2.3208830417618871, 1.0, 0.900}, {3.4813245626428309, 1.0, 0.900},
66 {4.6417660835237742, 1.0, 0.900}};
68 0.01281537532531727, 0.00686250007959751, 0.00442721737694587,
69 0.02165824447871323, 0.0117892550438441, 0.007657345769747112,
70 0.07176032468044616, 0.04304065885628561, 0.0292012072733511};
73 printf(
"\n## Test_fGWinKerr\n\n");
84#define COUNT_RKERRISCO 7
85#define TOLERANCE_RKERRISCO 1e-8
87 {-0.90}, {-0.60}, {-0.30}, {-0.00}, {0.30}, {0.60}, {0.90}};
89 8.717352279606489, 7.850686185306578, 6.949272527004718, 6, 4.97861683057595,
90 3.829069418813151, 2.320883041761887};
93 printf(
"\n## Test_rKerrISCO\n\n");
102#define COUNT_XI_TIDE 36
103#define TOLERANCE_XI_TIDE 1e-8
105 {2.00, -0.90, 0.28}, {2.00, -0.90, 0.34}, {2.00, -0.90, 0.4}, {2.00, 0.00, 0.28},
106 {2.00, 0.00, 0.34}, {2.00, 0.00, 0.4}, {2.00, 0.90, 0.28}, {2.00, 0.90, 0.34}, {2.00, 0.90, 0.4},
107 {3.00, -0.90, 0.42}, {3.00, -0.90, 0.51}, {3.00, -0.90, 0.6}, {3.00, 0.00, 0.42},
108 {3.00, 0.00, 0.51}, {3.00, 0.00, 0.6}, {3.00, 0.90, 0.42}, {3.00, 0.90, 0.51}, {3.00, 0.90, 0.6},
109 {4.00, -0.90, 0.56}, {4.00, -0.90, 0.68}, {4.00, -0.90, 0.8}, {4.00, 0.00, 0.56},
110 {4.00, 0.00, 0.68}, {4.00, 0.00, 0.8}, {4.00, 0.90, 0.56}, {4.00, 0.90, 0.68}, {4.00, 0.90, 0.8},
111 {5.00, -0.90, 0.7}, {5.00, -0.90, 0.85}, {5.00, -0.90, 1}, {5.00, 0.00, 0.7}, {5.00, 0.00, 0.85},
112 {5.00, 0.00, 1}, {5.00, 0.90, 0.7}, {5.00, 0.90, 0.85}, {5.00, 0.90, 1}};
114 2.06871189988092, 2.165647459230484, 2.279729557247444, 1.957702074572125,
115 2.005770585734644, 2.063058314326985, 1.874012683952472, 1.884478196440186,
116 1.894984431945135, 2.535178557740413, 2.72161470061767, 2.939474255173244,
117 2.324039062239011, 2.419350068761182, 2.5369293431522, 2.162563923478413,
118 2.178495207637674, 2.19511940553916, 2.992537647891789, 3.286528350419773,
119 3.623185704395681, 2.661277126455292, 2.820959995701167, 3.018859346483027,
120 2.397505338613715, 2.419802208282962, 2.444234246009384, 3.455945198308276,
121 3.868295212767634, 4.330079575392291, 2.991668576796354, 3.230879137923294,
122 3.522510111613574, 2.600443557587901, 2.630444772711848, 2.665283137995229};
125 printf(
"\n## Test_xi_tide\n\n");
136#define COUNT_COMPACTNESS_FROM_LAMBDA 21
137#define TOLERANCE_COMPACTNESS_FROM_LAMBDA 1e-8
139 {0.0}, {200.0}, {400.0}, {600.0}, {800.0}, {1000.0}, {1200.0}, {1400.0}, {1600.0}, {1800.0},
140 {2000.0}, {2200.0}, {2400.0}, {2600.0}, {2800.0}, {3000.0}, {3200.0}, {3400.0}, {3600.0}, {3800.0},
143 0.5, 0.1917006111637932, 0.1726108500082392, 0.1617580970945444,
144 0.1541985276023099, 0.1484152311071196, 0.1437420509536809,
145 0.1398274999660475, 0.1364636439460052, 0.1335173810600413,
146 0.1308984340168845, 0.1285427920411775, 0.1264034435624421,
147 0.1244448606165661, 0.1226395498186449, 0.1209658060963831,
148 0.1194061990393252, 0.1179465229202867, 0.1165750499338684,
149 0.1152819874103816, 0.114059075676274};
152 printf(
"\n## Test_compactness_from_lambda\n\n");
161#define COUNT_TORUS_MASS_FIT 36
162#define TOLERANCE_TORUS_MASS_FIT 1e-8
164 {2.00, -0.90, 0.14}, {2.00, -0.90, 0.17}, {2.00, -0.90, 0.20}, {2.00, 0.00, 0.14},
165 {2.00, 0.00, 0.17}, {2.00, 0.00, 0.20}, {2.00, 0.90, 0.14}, {2.00, 0.90, 0.17}, {2.00, 0.90, 0.20},
166 {3.00, -0.90, 0.14}, {3.00, -0.90, 0.17}, {3.00, -0.90, 0.20}, {3.00, 0.00, 0.14},
167 {3.00, 0.00, 0.17}, {3.00, 0.00, 0.20}, {3.00, 0.90, 0.14}, {3.00, 0.90, 0.17}, {3.00, 0.90, 0.20},
168 {4.00, -0.90, 0.14}, {4.00, -0.90, 0.17}, {4.00, -0.90, 0.20}, {4.00, 0.00, 0.14},
169 {4.00, 0.00, 0.17}, {4.00, 0.00, 0.20}, {4.00, 0.90, 0.14}, {4.00, 0.90, 0.17}, {4.00, 0.90, 0.20},
170 {5.00, -0.90, 0.14}, {5.00, -0.90, 0.17}, {5.00, -0.90, 0.20}, {5.00, 0.00, 0.14},
171 {5.00, 0.00, 0.17}, {5.00, 0.00, 0.20}, {5.00, 0.90, 0.14}, {5.00, 0.90, 0.17}, {5.00, 0.90, 0.20}};
173 0.02349705295506288, 0, 0, 0.1299454661328111, 0.0430073416291199, 0,
174 0.2882657031643916, 0.2332155204085186, 0.1778008350569429, 0, 0, 0,
175 0.06437920494437788, 0, 0, 0.2941998033123807, 0.2231866136920418,
176 0.1517306063389851, 0, 0, 0, 0, 0, 0, 0.2887085776862365, 0.2028602793140871,
177 0.1165992019782404, 0, 0, 0, 0, 0, 0, 0.2763968308942356, 0.1765433406768961,
178 0.07648328516666991};
181 printf(
"\n## Test_torus_mass_fit\n\n");
192int main(
int argc,
char *argv[]) {
double input_rKerrISCO[COUNT_RKERRISCO][1]
#define TOLERANCE_FGWINKERR
bool approximatelyEqual(REAL8 a, REAL8 b, REAL8 epsilon)
#define COUNT_COMPACTNESS_FROM_LAMBDA
int main(int argc, char *argv[])
#define COUNT_TORUS_MASS_FIT
static void Test_rKerrISCO(void)
double expected_compactness_from_lambda[COUNT_COMPACTNESS_FROM_LAMBDA]
static void Test_xi_tide(void)
double input_compactness_from_lambda[COUNT_COMPACTNESS_FROM_LAMBDA][1]
double input_fGWinKerr[COUNT_FGWINKERR][3]
double expected_xi_tide[COUNT_XI_TIDE]
double input_torus_mass_fit[COUNT_TORUS_MASS_FIT][3]
#define TOLERANCE_XI_TIDE
#define TOLERANCE_TORUS_MASS_FIT
void print_difference(const char *name, REAL8 u, REAL8 u_expected)
double input_xi_tide[COUNT_XI_TIDE][3]
static void Test_torus_mass_fit(void)
double expected_rKerrISCO[COUNT_RKERRISCO]
double expected_torus_mass_fit[COUNT_TORUS_MASS_FIT]
static void Test_compactness_from_lambda(void)
#define TOLERANCE_COMPACTNESS_FROM_LAMBDA
double expected_fGWinKerr[COUNT_FGWINKERR]
static void Test_fGWinKerr(void)
#define TOLERANCE_RKERRISCO
double XLALSimNSBH_compactness_from_lambda(const REAL8 Lambda)
Compactness as a function of tidal deformability.
double XLALSimNSBH_torus_mass_fit(const REAL8 q, const REAL8 a, const REAL8 C)
Baryonic mass of the torus remnant of a BH-NS merger.
double XLALSimNSBH_fGWinKerr(const REAL8 r, const REAL8 M, const REAL8 a)
GW frequency for a particle on Kerr.
double XLALSimNSBH_xi_tide(const REAL8 q, const REAL8 a, const REAL8 mu)
Relativistic correction to orbital radius at mass-shedding.
double XLALSimNSBH_rKerrISCO(const REAL8 a)
Kerr BH ISCO radius.
#define XLAL_CHECK_EXIT(assertion)
char output[FILENAME_MAX]