LALSimulation  5.4.0.1-fe68b98
LALSimIMRPhenomX_qnm.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Sascha Husa, Geraint Pratten
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 Sascha Husa
23  * \author Geraint Pratten
24  *
25  */
26 
27 #include "LALSimIMRPhenomX_qnm.h"
28 
29 #if QNMfits == 1
30 /**
31  * evaluate fit QNMData_fring_22
32  */
33 static double evaluate_QNMfit_fring22(double finalDimlessSpin){
34 
35 double return_val;
36 
37 if (fabs(finalDimlessSpin) > 1.0) {
38  XLAL_ERROR(XLAL_EDOM, "PhenomX evaluate_QNMfit_fring22 \
39 function: |finalDimlessSpin| > 1.0 not supported");
40 }
41 
42 double x2= finalDimlessSpin*finalDimlessSpin;
43 double x3= x2*finalDimlessSpin;
44 double x4= x2*x2;
45 double x5= x3*x2;
46 double x6= x3*x3;
47 double x7= x4*x3;
48 
49 return_val = (0.05947169566573468 - \
50 0.14989771215394762*finalDimlessSpin + 0.09535606290986028*x2 + \
51 0.02260924869042963*x3 - 0.02501704155363241*x4 - \
52 0.005852438240997211*x5 + 0.0027489038393367993*x6 + \
53 0.0005821983163192694*x7)/(1 - 2.8570126619966296*finalDimlessSpin + \
54 2.373335413978394*x2 - 0.6036964688511505*x4 + \
55 0.0873798215084077*x6);
56 return return_val;
57 }
58 
59 
60 /**
61  * evaluate fit QNMData_fdamp_22
62  */
63 static double evaluate_QNMfit_fdamp22(double finalDimlessSpin){
64 
65 double return_val;
66 
67 if (fabs(finalDimlessSpin) > 1.0) {
68  XLAL_ERROR(XLAL_EDOM, "PhenomX evaluate_QNMfit_fdamp22 \
69 function: |finalDimlessSpin| > 1.0 not supported");
70 }
71 
72 double x2= finalDimlessSpin*finalDimlessSpin;
73 double x3= x2*finalDimlessSpin;
74 double x4= x2*x2;
75 double x5= x3*x2;
76 double x6= x3*x3;
77 
78 return_val = (0.014158792290965177 - \
79 0.036989395871554566*finalDimlessSpin + 0.026822526296575368*x2 + \
80 0.0008490933750566702*x3 - 0.004843996907020524*x4 - \
81 0.00014745235759327472*x5 + 0.0001504546201236794*x6)/(1 - \
82 2.5900842798681376*finalDimlessSpin + 1.8952576220623967*x2 - \
83 0.31416610693042507*x4 + 0.009002719412204133*x6);
84 return return_val;
85 }
86 
87 
88 #else
89  /**
90  * evaluate interpolated data set QNMData_fring_22, see Berti et al, CQG, 26, 163001, (2009)
91  */
92 static double interpolateQNMData_fring_22(double finalDimlessSpin) {
93  double return_val;
94 
95  if (fabs(finalDimlessSpin) > 1.0) {
96  XLAL_ERROR(XLAL_EDOM, "PhenomX interpolateQNMData_fring_22 function: |finalDimlessSpin| > 1.0 not supported");
97  }
98  gsl_interp_accel *acc = gsl_interp_accel_alloc();
99  gsl_spline *iData = gsl_spline_alloc(gsl_interp_cspline, QNMData_fring_22_length);
100  gsl_spline_init(iData, QNMData_a, QNMData_fring_22, QNMData_fring_22_length);
101 
102  return_val = gsl_spline_eval(iData, finalDimlessSpin, acc);
103 
104  gsl_spline_free(iData);
105  gsl_interp_accel_free(acc);
106  return return_val;
107  }
108 
109 
110  /**
111  * evaluate interpolated data set QNMData_fdamp_22, see Berti et al, CQG, 26, 163001, (2009)
112  */
113 static double interpolateQNMData_fdamp_22(double finalDimlessSpin) {
114  double return_val;
115 
116  if (fabs(finalDimlessSpin) > 1.0) {
117  XLAL_ERROR(XLAL_EDOM, "PhenomX interpolateQNMData_fdamp_22 function: |finalDimlessSpin| > 1.0 not supported");
118  }
119  gsl_interp_accel *acc = gsl_interp_accel_alloc();
120  gsl_spline *iData = gsl_spline_alloc(gsl_interp_cspline, QNMData_fdamp_22_length);
121  gsl_spline_init(iData, QNMData_a, QNMData_fdamp_22, QNMData_fdamp_22_length);
122 
123  return_val = gsl_spline_eval(iData, finalDimlessSpin, acc);
124 
125  gsl_spline_free(iData);
126  gsl_interp_accel_free(acc);
127  return return_val;
128  }
129 
130  #endif
static const double QNMData_a[]
static double evaluate_QNMfit_fdamp22(double finalDimlessSpin)
evaluate fit QNMData_fdamp_22
static double evaluate_QNMfit_fring22(double finalDimlessSpin)
evaluate fit QNMData_fring_22
static const int QNMData_fdamp_22_length
static const int QNMData_fring_22_length
static const double QNMData_fdamp_22[]
static const double QNMData_fring_22[]
#define XLAL_ERROR(...)
XLAL_EDOM