LALInspiralVelocity.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, 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="LALInspiralVelocityCV">
00021 Author: Sathyaprakash, B. S.
00022 $Id: LALInspiralVelocity.c,v 1.10 2007/06/08 14:41:49 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralVelocity.c}}
00028 
00029 The function \texttt{LALInspiralVelocity} calculates the velocity $v$ which corresponds to a time $t$ in
00030 the inspiralling binary system.
00031 
00032 \subsubsection*{Prototypes}
00033 \vspace{0.1in}
00034 \input{LALInspiralVelocityCP}
00035 \idx{LALInspiralVelocity()}
00036 
00037 \subsubsection*{Description}
00038 
00039 The function \texttt{LALInspiralVelocity} calculates the velocity $v$ corresponding to a time $t$ 
00040 in the evolution of an inspiralling binary system.  It does this by iteratively solving
00041 \begin{equation}
00042 t(v) =  t_{0} - m \int_{v_{0}}^{v} \frac{E'(v)}{{\cal F}(v)} \, dv \,\,.
00043 \label{tofv}
00044 \end{equation}
00045 \texttt{LALInspiralVelocity} calculates $v$, given $t(v)$, 
00046 $t_{0}$, $m$, $v_{0}$, $E^{\prime}(v)$ and $\mathcal{F}(v)$.
00047 
00048 \subsubsection*{Algorithm}
00049 
00050 
00051 \subsubsection*{Uses}
00052 
00053 \texttt{LALDBisectionFindRoot}
00054 
00055 \subsubsection*{Notes}
00056 
00057 \vfill{\footnotesize\input{LALInspiralVelocityCV}}
00058 
00059 </lalLaTeX>  */
00060 
00061 #include <math.h>
00062 #include <lal/LALStdlib.h>
00063 #include <lal/LALInspiral.h>
00064 #include <lal/FindRoot.h>
00065 
00066 NRCSID (LALINSPIRALVELOCITYC, "$Id: LALInspiralVelocity.c,v 1.10 2007/06/08 14:41:49 bema Exp $"); 
00067 
00068 /*  <lalVerbatim file="LALInspiralVelocityCP"> */
00069 void 
00070 LALInspiralVelocity(
00071    LALStatus *status,
00072    REAL8     *v,
00073    TofVIn    *ak
00074    )
00075 { /* </lalVerbatim>  */
00076 
00077   DFindRootIn rootIn;
00078   void *funcParams;
00079 
00080 
00081   INITSTATUS (status, "LALInspiralVelocity", LALINSPIRALVELOCITYC);
00082   ATTATCHSTATUSPTR(status);
00083 
00084   ASSERT (v, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00085   ASSERT (ak, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00086 
00087   rootIn.function = LALInspiralTofV;
00088   rootIn.xmax = ak->vlso;
00089   rootIn.xmin = ak->v0/2.;
00090   rootIn.xacc = 1.0e-8;
00091 
00092   funcParams = (void *) ak;
00093 
00094 
00095   if (ak->t==ak->t0) 
00096   {
00097      *v = ak->v0;
00098      DETATCHSTATUSPTR(status);
00099      RETURN(status);
00100   }
00101 
00102   LALDBisectionFindRoot(status->statusPtr, v, &rootIn, funcParams);
00103   CHECKSTATUSPTR(status);
00104 
00105   DETATCHSTATUSPTR(status);
00106   RETURN(status);
00107 }

Generated on Fri Sep 5 03:07:07 2008 for LAL by  doxygen 1.5.2