Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralBankUtils.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Thomas Cokelaer
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 * \defgroup LALInspiralBankUtils_c Module LALInspiralBankUtils.c
22 * \ingroup LALInspiralBank_h
23 * \author Cokelaer Thomas
24 *
25 * \brief NONE
26 *
27 * ### Description ###
28 *
29 * In a parameter space defined by \f$m_1\f$ and \f$m_2\f$, or equivalently, \f$M=m_1+m_2\f$ and \f$\eta=\frac{m_1 m_2}{M^2}\f$, the conversion
30 * to chirp-time parameter such as \f$\tau_0\f$ and \f$\tau_3\f$ si quite common. In particular, it is interesting to get the value of
31 * \f$\tau_3\f$ when only \f$\tau_0\f$ is known, and a constraint on the masses exists (e.g., \f$m_1=m_2\f$ or one of the mass equals mMin or mMax.
32 * This modules contains a few functions to perform these conversion.
33 *
34 * ### Algorithm ###
35 *
36 * We know that
37 * \f{equation}{
38 * \label{eq_tau0a}
39 * \tau_0 = \frac{A_0}{\eta} M^{-5/2},
40 * \f}
41 * and
42 * \f{equation}{
43 * \tau_3 = \frac{A_3}{\eta} M^{-2/3},
44 * \f}
45 * where
46 * \f{equation}{
47 * A_0 = \frac{5}{256 (\pi *f_L)^{8/3}},
48 * \f}
49 * and
50 * \f{equation}{
51 * A_3 = \frac{\pi}{8 (\pi *f_L)^{5/3}},
52 * \f}
53 *
54 * Therefore, it is straightforward to express \f$\tau_3\f$ as a function of \f$\tau_0\f$ amd \f$\eta\f$:
55 * \f{equation}{
56 * \label{eq_tau3b}
57 * \tau_3 = \frac{A3}{\eta} \left( \frac{\tau_0 \eta}{ A_0} \right)^{2/5}
58 * \f}
59 * if \f$\eta=0.25\f$ on the equal-mass line, then
60 * \f{equation}{
61 * \label{eq_tau3a}
62 * \tau_3 = 4 A3 \left( \frac{\tau_0}{ 4 A_0} \right)^{2/5}
63 * \f}
64 *
65 * \eqref{eq_tau3b} returns \f$\tau_3\f$ given in \f$M, \eta\f$ and \f$f_L\f$ and is defined
66 * in\c XLALInspiralTau3FromNonEqualMass().
67 *
68 * \eqref{eq_tau3a} returns tau3 in the particular case \f$m_1=m_2\f$, given
69 * \f$\tau_0\f$ only, and is defined in \c XLALInspiralTau3FromTau0AndEqualMassLine().
70 *
71 * \eqref{eq_tau0a} returns \f$tau_0\f$ given \f$M, \eta\f$ and \f$f_L\f$, and is defined
72 * \c XLALInspiralTau0FromMEta().
73 *
74 * Finally, \c XLALInspiralMFromTau0AndNonEqualMass() returns \f$M\f$ when \f$\tau_0\f$ is known
75 * and a constraint exists on one of the individual mass (e.g., \f$m_1=\textrm{mMax}\f$ or
76 * \f$m_1=\textrm{mMin}\f$). This functions requires a little more algebra and is used in the
77 * HybridHexagonal placement. The \ref LALInspiralHybridHexagonalBank_c describes this algebra.
78 *
79 */
80/** @{ */
81
82#include <stdio.h>
83#include <lal/LALStdio.h>
84#include <lal/LALConstants.h>
85#include <lal/AVFactories.h>
86#include <lal/SeqFactories.h>
87#include <lal/FindRoot.h>
88#include <lal/LALInspiralBank.h>
89#include <math.h>
90
91
92/** \see See \ref LALInspiralBankUtils_c for documentation */
95 REAL4 tau0,
96 REAL4 fL
97 )
98{
99 REAL4 A0, A3, tau3=0;
100
101
102 A0 = (5.0 / 256.0) * pow(LAL_PI * fL, (-8.0/3.0));
103 A3 = LAL_PI / (8.0 * pow(LAL_PI * fL, (5.0/3.0)));
104
105 tau3 = 4 * A3 * pow(tau0/4/A0, 2./5.);
106
107 return tau3;
108}
109
110
111/** \see See \ref LALInspiralBankUtils_c for documentation */
112REAL4
114 REAL4 M,
115 REAL4 eta,
116 REAL4 fL
117 )
118{
119 REAL4 A3;
120 REAL4 tau3 = 0;
121
122 A3 = LAL_PI / (8.0 * pow(LAL_PI*fL, (5.0/3.0)));
123 tau3 = A3 * pow(M * LAL_MTSUN_SI, -2.0/3.0) / eta;
124
125 return tau3;
126}
127
128/** \see See \ref LALInspiralBankUtils_c for documentation */
129REAL4
131 REAL4 M,
132 REAL4 eta,
133 REAL4 fL
134 )
135{
136
137/* This function returns tau3, computed from M and eta*/
138
139 REAL4 A0;
140 REAL4 tau0 = 0;
141
142 A0 = (5.0 / 256.0) * pow( LAL_PI * fL, (-8.0/3.0));
143 tau0 = A0 * pow(M*LAL_MTSUN_SI, -5.0/3.0) / eta;
144
145 return tau0;
146}
147
148/** \see See \ref LALInspiralBankUtils_c for documentation */
149REAL8
151 REAL8 tau0,
152 REAL8 extremMass,
153 REAL8 fL)
154{
155 REAL8 result, A0, p, q, x;
156
157 A0 = (5.0 / 256.0) * pow( LAL_PI * fL, (-8.0/3.0));
158
159 /* from tau0, and M, we can get a poylomial expression where M is the
160 unknowm of the form x^3+px+q =0 where x = M^(1/3) and p and q as follows :*/
161 p = -A0/tau0/extremMass/LAL_MTSUN_SI;
162 q = -extremMass * LAL_MTSUN_SI;
163
164 x = pow((-q/2-0.5*sqrt((27*q*q + 4*p*p*p)/27)), 1./3.);
165 x += pow((-q/2+0.5*sqrt((27*q*q + 4*p*p*p)/27)), 1./3.);
166
167 /* This is a real solution and M is simply */
168 result = x*x*x/LAL_MTSUN_SI;
169
170 return result;
171}
172/** @} */
#define LAL_PI
#define LAL_MTSUN_SI
double REAL8
float REAL4
REAL4 XLALInspiralTau3FromTau0AndEqualMassLine(REAL4 tau0, REAL4 fL)
REAL8 XLALInspiralMFromTau0AndNonEqualMass(REAL8 tau0, REAL8 extremMass, REAL8 fL)
REAL4 XLALInspiralTau3FromNonEqualMass(REAL4 M, REAL4 eta, REAL4 fL)
REAL4 XLALInspiralTau0FromMEta(REAL4 M, REAL4 eta, REAL4 fL)
static const INT4 q
M
p
x