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
LALInspiralTofV.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 NONE
26 *
27 * This module outputs
28 * \f{equation}{
29 * tofv = t - t_0 + m \int_{v_0}^{v} \frac{E'(v)}{{\cal F}(v)} \, dv\,.
30 * \f}
31 * where the constants \f$t,\f$ \f$t_0,\f$ \f$v_0,\f$ and functions in the integrand
32 * \f$E'(v)\f$ and \f${\cal F}(v)\f$ are defined in the \c void structure <tt>params.</tt>
33 *
34 * ### Uses ###
35 *
36 * \code
37 * LALDRombergIntegrate()
38 * \endcode
39 *
40 */
41
42#include <math.h>
43#include <lal/Integrate.h>
44#include <lal/LALAtomicDatatypes.h>
45#include <lal/LALInspiral.h>
46#include <lal/XLALError.h>
47
50 REAL8 v,
51 void *params
52 )
53{
54 void *funcParams;
55 REAL8 (*funcToIntegrate)(REAL8, void *);
56 REAL8 xmin, xmax;
57 IntegralType type;
59 TofVIn *in1;
60 REAL8 answer;
61 REAL8 sign;
62
63
64 if (params == NULL)
66 if (v <= 0.)
68 if (v >= 1.)
70
71 sign = 1.0;
72
73
74 in1 = (TofVIn *) params;
75
76 funcToIntegrate = XLALInspiralTofVIntegrand;
77 xmin = in1->v0;
78 xmax = v;
79 type = ClosedInterval;
80
81
82 in2.dEnergy = in1->dEnergy;
83 in2.flux = in1->flux;
84 in2.coeffs = in1->coeffs;
85
86 funcParams = (void *) &in2;
87
88 if (v==in1->v0)
89 {
90 return in1->t - in1->t0;
91 }
92
93 if(in1->v0 > v)
94 {
95 xmin = v;
96 xmax = in1->v0;
97 sign = -1.0;
98 }
99
100 answer = XLALREAL8RombergIntegrate (funcToIntegrate, funcParams, xmin, xmax, type);
101 if (XLAL_IS_REAL8_FAIL_NAN(answer))
103
104 return in1->t - in1->t0 + in1->totalmass*answer*sign;
105}
REAL8 XLALInspiralTofVIntegrand(REAL8 v, void *params)
REAL8 XLALInspiralTofV(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
REAL8 t0
Definition: LALInspiral.h:567
REAL8 v0
Definition: LALInspiral.h:566
REAL8 totalmass
Definition: LALInspiral.h:569
EnergyFunction dEnergy
expnCoeffsdEnergyFlux * coeffs
REAL8 t
Definition: LALInspiral.h:565
FluxFunction flux
EnergyFunction dEnergy
expnCoeffsdEnergyFlux * coeffs
FluxFunction flux