LALSimulation  5.4.0.1-fe68b98
LALSimRingdownCW.c
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2016 Lionel London
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 /* HEADER SECTION */
22 /* .................... */
23 #ifdef __GNUC__
24 #define UNUSED __attribute__ ((unused))
25 #else
26 #define UNUSED
27 #endif
28 
29 #include <stdio.h>
30 #include <stdbool.h>
31 #include <math.h>
32 #include <complex.h>
33 #include <stdlib.h>
34 
35 #include <lal/Units.h>
36 #include <lal/LALConstants.h>
37 #include <lal/XLALError.h>
38 
39 #include "LALSimRingdownCW.h"
40 
41 /*
42 * Based on the paper by London and Fauchon-Jones: https://arxiv.org/abs/1810.03550
43 * Basic NOTE(s):
44 * - This file contains a function, CW07102016, which outputs complex valued, UNITLESS, QNM frequencies (i.e. Mw) for various QNMs
45 * - Usage: cw = CW07102016( kappa, l, m, n ); where cw = Mw + 1i*M/tau; NOTE that kappa is a function of final spin, l and m
46 * - See definition of KAPPA below.
47 */
48 
49 /*
50 * -------------------------------------------------------------------------------- *
51 * Low level models: QNM Frequencies
52 * -------------------------------------------------------------------------------- *
53 */
54 
55 /*
56 * Domain mapping for dimnesionless BH spin
57 */
58 double SimRingdownCW_KAPPA(double jf, int l, int m)
59 {
60  /* */
61  /* if ( jf > 1.0 ) XLAL_ERROR(XLAL_EDOM, "Spin (dimensionless Kerr parameter) must not be greater than 1.0\n"); */
62  /**/
63  double alpha = log(2.0 - jf) / log(3);
64  double beta = 1.0 / (2.0 + l - abs(m));
65  return pow(alpha, beta);
66 }
67 
68 /*
69 * Dimensionless QNM Frequencies: Note that name encodes date of writing
70 */
71 /*TODO: Make the function arg comments compatible with doxygen*/
72 complex double SimRingdownCW_CW07102016(double kappa, /* Domain mapping for remnant BH's spin (Dimensionless) */
73  int l, /* Polar eigenvalue */
74  int input_m, /* Azimuthal eigenvalue*/
75  int n)
76 { /* Overtone Number*/
77 
78  /* Predefine powers to increase efficiency*/
79  double kappa2 = kappa * kappa;
80  double kappa3 = kappa2 * kappa;
81  double kappa4 = kappa3 * kappa;
82 
83  /* NOTE that |m| will be used to determine the fit to use, and if input_m < 0, then a conjugate will be taken*/
84  int m = abs(input_m);
85 
86  /**/
87  complex double j = _Complex_I;
88 
89  /* Initialize the answer*/
90  double complex ans;
91 
92  /* Use If-Else ladder to determine which mode function to evaluate*/
93  if (2 == l && 2 == m && 0 == n)
94  {
95 
96  /* Fit for (l,m,n) == (2,2,0). This is a zero-damped mode in the extremal Kerr limit.*/
97  ans = 1.0 + kappa * (1.557847 * cexp(2.903124 * j) +
98  1.95097051 * cexp(5.920970 * j) * kappa +
99  2.09971716 * cexp(2.760585 * j) * kappa2 +
100  1.41094660 * cexp(5.914340 * j) * kappa3 +
101  0.41063923 * cexp(2.795235 * j) * kappa4);
102  }
103  else if (2 == l && 2 == m && 1 == n)
104  {
105 
106  /* Fit for (l,m,n) == (2,2,1). This is a zero-damped mode in the extremal Kerr limit.*/
107  ans = 1.0 + kappa * (1.870939 * cexp(2.511247 * j) +
108  2.71924916 * cexp(5.424999 * j) * kappa +
109  3.05648030 * cexp(2.285698 * j) * kappa2 +
110  2.05309677 * cexp(5.486202 * j) * kappa3 +
111  0.59549897 * cexp(2.422525 * j) * kappa4);
112  }
113  else if (3 == l && 2 == m && 0 == n)
114  {
115 
116  /* Define extra powers as needed*/
117  double kappa5 = kappa4 * kappa;
118  double kappa6 = kappa5 * kappa;
119 
120  /* Fit for (l,m,n) == (3,2,0). This is NOT a zero-damped mode in the extremal Kerr limit.*/
121  ans = 1.022464 * cexp(0.004870 * j) +
122  0.24731213 * cexp(0.665292 * j) * kappa +
123  1.70468239 * cexp(3.138283 * j) * kappa2 +
124  0.94604882 * cexp(0.163247 * j) * kappa3 +
125  1.53189884 * cexp(5.703573 * j) * kappa4 +
126  2.28052668 * cexp(2.685231 * j) * kappa5 +
127  0.92150314 * cexp(5.841704 * j) * kappa6;
128  }
129  else if (4 == l && 4 == m && 0 == n)
130  {
131 
132  /* Fit for (l,m,n) == (4,4,0). This is a zero-damped mode in the extremal Kerr limit.*/
133  ans = 2.0 + kappa * (2.658908 * cexp(3.002787 * j) +
134  2.97825567 * cexp(6.050955 * j) * kappa +
135  3.21842350 * cexp(2.877514 * j) * kappa2 +
136  2.12764967 * cexp(5.989669 * j) * kappa3 +
137  0.60338186 * cexp(2.830031 * j) * kappa4);
138  }
139  else if (2 == l && 1 == m && 0 == n)
140  {
141 
142  /* Define extra powers as needed*/
143  double kappa5 = kappa4 * kappa;
144  double kappa6 = kappa5 * kappa;
145 
146  /* Fit for (l,m,n) == (2,1,0). This is NOT a zero-damped mode in the extremal Kerr limit.*/
147  ans = 0.589113 * cexp(0.043525 * j) +
148  0.18896353 * cexp(2.289868 * j) * kappa +
149  1.15012965 * cexp(5.810057 * j) * kappa2 +
150  6.04585476 * cexp(2.741967 * j) * kappa3 +
151  11.12627777 * cexp(5.844130 * j) * kappa4 +
152  9.34711461 * cexp(2.669372 * j) * kappa5 +
153  3.03838318 * cexp(5.791518 * j) * kappa6;
154  }
155  else if (3 == l && 3 == m && 0 == n)
156  {
157 
158  /* Fit for (l,m,n) == (3,3,0). This is a zero-damped mode in the extremal Kerr limit.*/
159  ans = 1.5 + kappa * (2.095657 * cexp(2.964973 * j) +
160  2.46964352 * cexp(5.996734 * j) * kappa +
161  2.66552551 * cexp(2.817591 * j) * kappa2 +
162  1.75836443 * cexp(5.932693 * j) * kappa3 +
163  0.49905688 * cexp(2.781658 * j) * kappa4);
164  }
165  else if (3 == l && 3 == m && 1 == n)
166  {
167 
168  /* Fit for (l,m,n) == (3,3,1). This is a zero-damped mode in the extremal Kerr limit.*/
169  ans = 1.5 + kappa * (2.339070 * cexp(2.649692 * j) +
170  3.13988786 * cexp(5.552467 * j) * kappa +
171  3.59156756 * cexp(2.347192 * j) * kappa2 +
172  2.44895997 * cexp(5.443504 * j) * kappa3 +
173  0.70040804 * cexp(2.283046 * j) * kappa4);
174  }
175  else if (4 == l && 3 == m && 0 == n)
176  {
177 
178  /* Fit for (l,m,n) == (4,3,0). This is a zero-damped mode in the extremal Kerr limit.*/
179  ans = 1.5 + kappa * (0.205046 * cexp(0.595328 * j) +
180  3.10333396 * cexp(3.016200 * j) * kappa +
181  4.23612166 * cexp(6.038842 * j) * kappa2 +
182  3.02890198 * cexp(2.826239 * j) * kappa3 +
183  0.90843949 * cexp(5.915164 * j) * kappa4);
184  }
185  else if (5 == l && 5 == m && 0 == n)
186  {
187 
188  /* Fit for (l,m,n) == (5,5,0). This is a zero-damped mode in the extremal Kerr limit. */
189  ans = 2.5 + kappa * (3.240455 * cexp(3.027869 * j) +
190  3.49056455 * cexp(6.088814 * j) * kappa +
191  3.74704093 * cexp(2.921153 * j) * kappa2 +
192  2.47252790 * cexp(6.036510 * j) * kappa3 +
193  0.69936568 * cexp(2.876564 * j) * kappa4);
194  }
195  else
196  {
197 
198  /**/
199  ans = 0.0;
200 
201  } /* END of IF-ELSE Train for QNM cases */
202 
203  /* If m<0, then take the *Negative* conjugate */
204  if (input_m < 0)
205  {
206  /**/
207  ans = -conj(ans);
208  }
209 
210  return ans;
211 
212 } /* END of CW07102016 */
static double beta(const double a, const double b, const sysq *system)
Internal function that computes the spin-orbit couplings.
double SimRingdownCW_KAPPA(double jf, int l, int m)
complex double SimRingdownCW_CW07102016(double kappa, int l, int input_m, int n)
int l
Definition: bh_qnmode.c:135
static const INT4 m
double alpha
Definition: sgwb.c:106