Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralPhasing1.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 David Churches, B.S. Sathyaprakash, Drew Keppel
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 * \author Sathyaprakash, B. S.
22 * \file
23 * \ingroup LALInspiral_h
24 *
25 * \brief This module is used to set the phase of the waveform so that
26 * it is equal to the user specified phase \f$\phi_0\f$ when the `velocity' of the
27 * system is equal to \f$v.\f$
28 *
29 * ### Prototypes ###
30 *
31 * <tt>XLALInspiralPhasing1()</tt>
32 *
33 * ### Description ###
34 *
35 * The function \c XLALInspiralPhasing1() calculates the phase \f$\phi(v)\f$ using
36 * the phasing formula,
37 * \f{equation}{
38 * \label{phiofv}
39 * \phi(v) = \phi_{0} - 2 \int_{v_{0}}^{v} v^{3} \frac{E'(v)}{{\cal F}(v)} \, dv \,\,.
40 * \f}
41 * \c XLALInspiralPhasing1() calculates \f$\phi(v)\f$, given \f$\phi_{0}\f$, \f$v_{0}\f$,
42 * \f$v\f$, \f$E^{\prime}(v)\f$ and \f$\mathcal{F}(v)\f$. The user can specify the phase to
43 * be of a particular value at an arbitrary point on the waveform when the
44 * post-Newtonian evolution variable \f$v\f$ reaches a specific value. Choosing
45 * \f$v=v_0,\f$ the initial velocity, means that the initial phase of the wave is \f$\phi_0;\f$
46 * Choosing \f$v=v_\textrm{lso}\f$ means that the phase at the last stable orbit is \f$\phi_0\f$ and
47 * so on.
48 *
49 * ### Algorithm ###
50 *
51 * Numerical integration.
52 *
53 * ### Uses ###
54 *
55 * XLALDRombergIntegrate()
56 *
57 * ### Notes ###
58 *
59 */
60
61#include <math.h>
62#include <lal/Integrate.h>
63#include <lal/LALAtomicDatatypes.h>
64#include <lal/LALInspiral.h>
65#include <lal/XLALError.h>
66
69 REAL8 v,
70 void *params
71 )
72{
73 void *funcParams;
74 REAL8 (*integratedfunction)(REAL8, void *);
75 REAL8 xmin, xmax;
76 IntegralType integrationtype;
78 InspiralPhaseIn *in1;
79 REAL8 sign;
80 REAL8 answer, phiofv;
81
82 if (params == NULL)
84 if (v <= 0.)
86 if (v >= 1.)
88
89 sign = 1.0;
90
91 in1 = (InspiralPhaseIn *) params;
92
93 integratedfunction = XLALInspiralPhiofVIntegrand;
94 xmin = in1->v0;
95 xmax = v;
96 integrationtype = ClosedInterval;
97
98 in2.dEnergy = in1->dEnergy;
99 in2.flux = in1->flux;
100 in2.coeffs = in1->coeffs;
101
102 funcParams = (void *) &in2;
103
104 if (v==in1->v0) {
105 return in1->phi0;
106 }
107
108 if(in1->v0 > v) {
109 xmin = v;
110 xmax = in1->v0;
111 sign = -1.0;
112 }
113
114 answer = XLALREAL8RombergIntegrate (integratedfunction, funcParams, xmin, xmax, integrationtype);
115 if (XLAL_IS_REAL8_FAIL_NAN(answer))
117
118 phiofv = in1->phi0 - 2.0*sign*answer;
119
120 return phiofv;
121}
REAL8 XLALInspiralPhiofVIntegrand(REAL8, void *)
REAL8 XLALInspiralPhasing1(REAL8 v, void *params)
IntegralType
REAL8 XLALREAL8RombergIntegrate(REAL8(*f)(REAL8 x, void *params), void *params, REAL8 xmin, REAL8 xmax, IntegralType type)
ClosedInterval
double REAL8
#define XLAL_ERROR_REAL8(...)
#define XLAL_IS_REAL8_FAIL_NAN(val)
XLAL_EFAULT
XLAL_EFUNC
XLAL_EDOM
Structures used to compute the phase of the signal from the ‘beginning’, when the veolcity parameter ...
Definition: LALInspiral.h:654
EnergyFunction * dEnergy
Definition: LALInspiral.h:657
FluxFunction * flux
Definition: LALInspiral.h:658
expnCoeffs * coeffs
Definition: LALInspiral.h:659
Structures used to compute the phase of the signal from the ‘beginning’, when the veolcity parameter ...
Definition: LALInspiral.h:669
expnCoeffs * coeffs
Definition: LALInspiral.h:672
EnergyFunction * dEnergy
Definition: LALInspiral.h:670
FluxFunction * flux
Definition: LALInspiral.h:671