00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #include <math.h>
00060 #include <lal/LALStdlib.h>
00061 #include <lal/LALInspiral.h>
00062 #include <lal/Integrate.h>
00063
00064 NRCSID (LALINSPIRALTOFVC, "$Id: LALInspiralTofV.c,v 1.3 2007/06/08 14:41:49 bema Exp $");
00065
00066
00067 void
00068 LALInspiralTofV (
00069 LALStatus *status,
00070 REAL8 *tofv,
00071 REAL8 v,
00072 void *params
00073 )
00074 {
00075
00076 void *funcParams;
00077 DIntegrateIn intinp;
00078 TofVIntegrandIn in2;
00079 TofVIn *in1;
00080 REAL8 answer;
00081 REAL8 sign;
00082
00083
00084 INITSTATUS (status, "LALInspiralTofV", LALINSPIRALTOFVC);
00085 ATTATCHSTATUSPTR(status);
00086
00087 ASSERT (tofv, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00088 ASSERT (params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00089 ASSERT(v > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00090 ASSERT(v < 1., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00091
00092 sign = 1.0;
00093
00094
00095 in1 = (TofVIn *) params;
00096
00097 intinp.function = LALInspiralTofVIntegrand;
00098 intinp.xmin = in1->v0;
00099 intinp.xmax = v;
00100 intinp.type = ClosedInterval;
00101
00102
00103 in2.dEnergy = in1->dEnergy;
00104 in2.flux = in1->flux;
00105 in2.coeffs = in1->coeffs;
00106
00107 funcParams = (void *) &in2;
00108
00109 if (v==in1->v0)
00110 {
00111 *tofv = in1->t - in1->t0;
00112 DETATCHSTATUSPTR(status);
00113 RETURN (status);
00114 }
00115
00116 if(in1->v0 > v)
00117 {
00118 intinp.xmin = v;
00119 intinp.xmax = in1->v0;
00120 sign = -1.0;
00121 }
00122
00123 LALDRombergIntegrate (status->statusPtr, &answer, &intinp, funcParams);
00124 CHECKSTATUSPTR(status);
00125
00126 *tofv = in1->t - in1->t0 + in1->totalmass*answer*sign;
00127
00128 DETATCHSTATUSPTR(status);
00129 RETURN (status);
00130 }
00131