LALInspiralPhasing1.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="LALInspiralPhasing1CV">
00021 Author: Sathyaprakash, B. S.
00022 $Id: LALInspiralPhasing1.c,v 1.4 2007/06/08 14:41:49 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralPhasing1.c}}
00028 This module is used to set the phase of the waveform so that
00029 it is equal to the user specified phase $\phi_0$ when the `velocity' of the
00030 system is equal to $v.$ 
00031 
00032 \subsubsection*{Prototypes}
00033 \vspace{0.1in}
00034 \input{LALInspiralPhasing1CP}
00035 \index{\verb&LALInspiralPhasing1()&}
00036 
00037 \subsubsection*{Description}
00038 
00039 The function \texttt{LALInspiralPhasing1} calculates the phase $\phi(v)$ using
00040 the phasing formula,
00041 \begin{equation}
00042 \phi(v) =  \phi_{0} - 2 \int_{v_{0}}^{v} v^{3} \frac{E'(v)}{{\cal F}(v)} \, dv \,\,.
00043 \label{phiofv}
00044 \end{equation}
00045 \texttt{LALInspiralPhasing1} calculates $\phi(v)$, given $\phi_{0}$, $v_{0}$,  
00046 $v$, $E^{\prime}(v)$ and $\mathcal{F}(v)$.  The user can specify the phase to
00047 be of a particular value at an arbitrary point on the waveform when the
00048 post-Newtonian evolution variable $v$ reaches a specific value. Choosing
00049 $v=v_0,$ the initial velocity, means that the initial phase of the wave is $\phi_0;$
00050 Choosing $v=v_{\rm lso}$ means that the phase at the last stable orbit is $\phi_0$ and
00051 so on. 
00052 
00053 \subsubsection*{Algorithm}
00054 Numerical integration.
00055 
00056 \subsubsection*{Uses}
00057 
00058 \texttt{LALDRombergIntegrate}
00059 
00060 \subsubsection*{Notes}
00061 
00062 \vfill{\footnotesize\input{LALInspiralPhasing1CV}}
00063 
00064 </lalLaTeX>  */
00065 
00066 #include <math.h>
00067 #include <lal/LALStdlib.h>
00068 #include <lal/LALInspiral.h>
00069 #include <lal/Integrate.h>
00070 
00071 NRCSID (LALINSPIRALPHASING1C, "$Id: LALInspiralPhasing1.c,v 1.4 2007/06/08 14:41:49 bema Exp $"); 
00072 
00073 /*  <lalVerbatim file="LALInspiralPhasing1CP"> */
00074 void 
00075 LALInspiralPhasing1 (
00076    LALStatus *status,
00077    REAL8     *phiofv,
00078    REAL8     v,
00079    void      *params
00080    )
00081 { /* </lalVerbatim>  */
00082 
00083    void *funcParams;
00084    DIntegrateIn intinp;
00085    PhiofVIntegrandIn in2;
00086    InspiralPhaseIn *in1;
00087    REAL8 sign;
00088    REAL8 answer;
00089 
00090    INITSTATUS (status, "LALInspiralPhasing1", LALINSPIRALPHASING1C);
00091    ATTATCHSTATUSPTR (status);
00092 
00093    ASSERT (phiofv, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00094    ASSERT (params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00095    ASSERT (v > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00096    ASSERT (v < 1., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00097 
00098    sign = 1.0;
00099 
00100    in1 = (InspiralPhaseIn *) params;
00101 
00102    intinp.function = LALInspiralPhiofVIntegrand;
00103    intinp.xmin = in1->v0;
00104    intinp.xmax = v;
00105    intinp.type = ClosedInterval;
00106 
00107    in2.dEnergy = in1->dEnergy;
00108    in2.flux = in1->flux;
00109    in2.coeffs = in1->coeffs;
00110 
00111    funcParams = (void *) &in2;
00112 
00113    if (v==in1->v0) {
00114       *phiofv = in1->phi0;
00115       DETATCHSTATUSPTR (status);
00116       RETURN (status);
00117    }
00118 
00119    if(in1->v0 > v) {
00120       intinp.xmin = v;
00121       intinp.xmax = in1->v0;
00122       sign = -1.0;
00123    }
00124 
00125    LALDRombergIntegrate (status->statusPtr, &answer, &intinp, funcParams);
00126    CHECKSTATUSPTR (status);
00127 
00128    *phiofv = in1->phi0 - 2.0*sign*answer;
00129 
00130    DETATCHSTATUSPTR (status);
00131    RETURN (status);
00132 }
00133 

Generated on Sat Sep 6 03:07:11 2008 for LAL by  doxygen 1.5.2