LALInspiralTofV.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, B.S. Sathyaprakash
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /*  <lalVerbatim file="LALInspiralTofVCV">
00021 Author: Sathyaprakash, B. S.
00022 $Id: LALInspiralTofV.c,v 1.3 2007/06/08 14:41:49 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralTofV.c}}
00028 
00029 This module outputs 
00030 \begin{equation}
00031 {\tt tofv} = t - t_0 + m \int_{v_0}^{v} \frac{E'(v)}{{\cal F}(v)} \, dv\,.
00032 \end{equation}
00033 where the constants $t,$ $t_0,$ $v_0,$ and functions in the integrand 
00034 $E'(v)$ and ${\cal F}(v)$ are defined in the {\tt void} structure {\tt params.}
00035 
00036 \subsubsection*{Prototypes}
00037 \vspace{0.1in}
00038 \input{LALInspiralTofVCP}
00039 \index{\verb&LALInspiralTofV()&}
00040 
00041 \subsubsection*{Description}
00042 
00043 
00044 \subsubsection*{Algorithm}
00045 
00046 
00047 \subsubsection*{Uses}
00048 
00049 \texttt{LALDRombergIntegrate}
00050 
00051 \subsubsection*{Notes}
00052 
00053 \vfill{\footnotesize\input{LALInspiralTofVCV}}
00054 
00055 </lalLaTeX>  */
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 /*  <lalVerbatim file="LALInspiralTofVCP"> */
00067 void 
00068 LALInspiralTofV (
00069    LALStatus *status,
00070    REAL8 *tofv,
00071    REAL8 v,
00072    void *params
00073    )
00074 { /* </lalVerbatim>  */
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 

Generated on Sun Oct 12 02:32:05 2008 for LAL by  doxygen 1.5.2