LALSimulation  5.4.0.1-fe68b98
LALSimNSBHProperties.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Andrew Matas, Jonathan Thompson, Edward Fauchon-Jones, Sebastian Khan
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 #include <math.h>
21 #include <lal/LALSimIMR.h>
22 #include <lal/Units.h>
23 #include <lal/LALConstants.h>
24 #include <gsl/gsl_errno.h>
25 #include <gsl/gsl_spline.h>
26 #include <gsl/gsl_poly.h>
27 
28 #ifndef _OPENMP
29 #define omp ignore
30 #endif
31 
32 /**
33  * @author Andrew Matas, Jonathan Thompson, Edward Fauchon-Jones, Sebastian Khan
34  * @addtogroup LALSimNSBHProperties_c Module LALSimNSBHProperties.c
35  * @ingroup lalsimulation_general
36  * @brief Provides routines for NSBH waveform models.
37  * @{
38  *
39  * @name Kerr routines
40  * @{
41  */
42 
43 /**
44  * GW frequency for a particle on Kerr
45  *
46  * GW frequency (in units of inverse M_BH) for a particle at a given separation
47  * r from a Kerr BH with mass M and dimensionless spin parameter a.
48  */
50  const REAL8 r, /**< Separtion */
51  const REAL8 M, /**< Kerr BH mass */
52  const REAL8 a /**< Dimensionless spin parameter */
53 ) {
54  return 1.0/(LAL_PI*(a*M + sqrt(pow(r, 3.0)/M)));
55 }
56 
57 /**
58  * Kerr BH ISCO radius
59  *
60  * Kerr BH ISCO radius for a BH with unit mass as a function of its
61  * dimensionless spin parameter.
62  */
64  const REAL8 a /**< Dimensionless spin parameter */
65 ) {
66  REAL8 Z1 = 1.0 + pow(1.0 - pow(a, 2.0), 1.0/3.0)*(pow(1.0+a, 1.0/3.0) + pow(1.0-a, 1.0/3.0));
67  REAL8 Z2 = sqrt(3.0*pow(a,2.0) + pow(Z1, 2.0));
68  if (a > 0.0) {
69  return 3.0 + Z2 - sqrt((3.0 - Z1)*(3.0 + Z1 + 2.0*Z2));
70  } else {
71  return 3.0 + Z2 + sqrt((3.0 - Z1)*(3.0 + Z1 + 2.0*Z2));
72  }
73 }
74 
75 /**
76  * @}
77  *
78  * @name NSBH routines
79  * @{
80  */
81 
82 /**
83  * Relativistic correction to orbital radius at mass-shedding
84  *
85  * Relativistic correction to the standard Newtonian estimate of the orbital
86  * radius at mass-shedding. See Eq. (8) in https://arxiv.org/abs/1509.00512 for
87  * a description of the implicit equation for `xi_tide`.
88  */
90  const REAL8 q, /**< Mass ratio of the NSBH system M_BH/M_NS > 1 */
91  const REAL8 a, /**< The BH dimensionless spin parameter */
92  const REAL8 mu /**< The ratio of the BH and the NS radius M_BH/R_NS = q*C where C is the compactness C = M_NS/R_NS. */
93 ) {
94  REAL8 p[11] = {
95  -3.0*q*pow(mu,2.0)*pow(a,2.0),
96  0.0,
97  6*q*mu,
98  0.0,
99  -3.0*q,
100  0.0,
101  0.0,
102  2.0*a*pow(mu,1.5),
103  -3*mu,
104  0.0,
105  1.0};
106  double z[20];
107 
108  gsl_error_handler_t * error_handler = gsl_set_error_handler_off();
109  gsl_poly_complex_workspace * w = gsl_poly_complex_workspace_alloc(11);
110  if (!w)
111  XLAL_ERROR(XLAL_EFAILED, "Cannot setup workspace to solve for xi_tide");
112  int status = gsl_poly_complex_solve(p, 11, w, z);
113  gsl_poly_complex_workspace_free(w);
114  gsl_set_error_handler(error_handler);
115  if (status)
116  XLAL_ERROR(XLAL_EFAILED, "Cannot find solution for xi_tide");
117 
118  double root = 0.0;
119  for (int i=0; i<10; i++) {
120  if (fabs(z[2*i+1]) < 1.0E-5) {
121  if (z[2*i] > 0.0 && pow(z[2*i],2.0) > root) {
122  root = pow(z[2*i],2.0);
123  }
124  }
125  }
126 
127  return root;
128 }
129 
130 /**
131  * Compactness as a function of tidal deformability
132  *
133  * For Lambda > 1 this computes the NS compactness from the tidal
134  * deformability as described by the universal relation from N. Yagi
135  * and N. Yunes, Phys. Rep. 681 (2017), Eq. (78).
136  *
137  * For Lambda <= 1 this extrapolates to the BH limit such that the
138  * interpolation over [0, 1] is C^1 continuous as Lambda=1.
139  */
141  const REAL8 Lambda /**< Dimensionless tidal deformability */
142 ) {
143  // Fitting coefficients
144  const REAL8 a0 = 0.360;
145  const REAL8 a1 = -0.0355;
146  const REAL8 a2 = 0.000705;
147 
148  if (Lambda > 1) {
149  const REAL8 log_lambda = log(Lambda);
150  return a0 + a1*log_lambda + a2*pow(log_lambda,2.0);
151  } else {
152  const REAL8 L2 = Lambda*Lambda;
153  const REAL8 L3 = L2*Lambda;
154  return 0.5 + (3*a0-a1-1.5)*L2 + (-2*a0+a1+1)*L3;
155  }
156 }
157 
158 /**
159  * Baryonic mass of the torus remnant of a BH-NS merger
160  *
161  * Baryonic mass of the torus remnant of a BH-NS merger in units of the NS
162  * baryonic mass. See arXiv:1207.6304v1 for details on the "Newtonian" and the
163  * "relativistic" fits.
164  *
165  * See Eq. (11) in https://arxiv.org/abs/1509.00512 for the definition of this
166  * quantity.
167  */
169  const REAL8 q, /**< The binary mass ratio (assumes q>1) */
170  const REAL8 a, /**< The BH dimensionless spin parameter */
171  const REAL8 C /**< Neutron star compactness. */
172 ) {
173 
174  REAL8 mu = q*C;
175  REAL8 alpha = 0.296;
176  REAL8 beta = 0.171;
177  REAL8 xi = XLALSimNSBH_xi_tide(q, a, mu);
178  REAL8 Mtorus = alpha * xi * (1.0-2.0*C) - beta * mu * XLALSimNSBH_rKerrISCO(a);
179 
180  if (Mtorus <0.0)
181  return 0.0;
182  else
183  return Mtorus;
184 }
185 
186 /** @} */
187 
188 /** @} */
static double beta(const double a, const double b, const sysq *system)
Internal function that computes the spin-orbit couplings.
REAL8 M
Definition: bh_qnmode.c:133
double i
Definition: bh_ringdown.c:118
const double a2
const double w
const double Lambda
#define LAL_PI
double REAL8
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.
static const INT4 r
static const INT4 q
static const INT4 a
#define XLAL_ERROR(...)
XLAL_EFAILED
list p
list mu
string status
double alpha
Definition: sgwb.c:106