LALInspiralDerivatives.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="LALInspiralDerivativesCV">
00021 Author: Sathyaprakash, B. S.
00022 $Id: LALInspiralDerivatives.c,v 1.11 2007/12/09 17:52:00 thomas Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralDerivatives.c}}
00028 
00029 Module to calculate the RHS of the differential equations 
00030 in Eq.~(\ref{eq:ode2}).
00031 
00032 \subsubsection*{Prototypes}
00033 \vspace{0.1in}
00034 \input{LALInspiralDerivativesCP}
00035 \idx{LALInspiralDerivatives()}
00036 \begin{itemize}
00037 \item {\tt values:} Input containing the values of the variables $v$ and $\phi$ at the
00038 current time.
00039 \item {\tt dvalues:} Output containing the derivatives $dv/dt$ and $d\phi/dt$ at the
00040 current time.
00041 \item {\tt params:} Input  of type {\tt InspiralDerivativesIn} that must be
00042 cast to a {\tt void.}\\
00043 
00044 \end{itemize}
00045 
00046 \subsubsection*{Description}
00047 
00048 This module calculates the right-hand sides of
00049 the follwoing two coupled first-order differential equations which are
00050 solved to obtain the gravitational wave phasing equation, 
00051 as described in the documentation for the function \texttt{LALInspiralWave1}:
00052 The equations are
00053 \begin{equation}
00054 \frac{dv}{dt} = - \frac{\mathcal{F}(v)}{m E^{\prime}(v)},\ \ \ \ 
00055 \frac{d \phi(t)}{dt} = \frac{2v^{3}}{m}.
00056 \label{ode2}
00057 \end{equation}
00058 
00059 \subsubsection*{Algorithm}
00060 
00061 
00062 \subsubsection*{Uses}
00063 None.
00064 
00065 \subsubsection*{Notes}
00066 
00067 \begin{itemize}
00068 \item This function has been intentionally made non-LAL compliant in the sense that it 
00069 has no status structure.  This is because this code
00070 outputs the RHS of the differential equations
00071 and is called repeatedly by a function that integrates the two differential
00072 equations and should therefore not suffer from undue overheads. 
00073 \item The input {\tt params} is of type {\tt InspiralDerivativesIn} and must
00074 be cast to a void before calling this function. For example,\\[5pt]
00075 \texttt {
00076    InspiralDerivativesIn in3;\\
00077    void *funcParams;\\[5pt]
00078    in3.totalmass = totalmass;\\
00079    $\ldots$\\
00080    funcParams = (void *) \&in3;
00081    }
00082 
00083 \end{itemize}
00084 
00085 \vfill{\footnotesize\input{LALInspiralDerivativesCV}}
00086 
00087 </lalLaTeX>  */
00088 
00089 #include <lal/LALInspiral.h>
00090 #include <lal/LALStdlib.h>
00091 
00092 NRCSID (LALINSPIRALDERIVATIVESC, "$Id: LALInspiralDerivatives.c,v 1.11 2007/12/09 17:52:00 thomas Exp $");
00093 
00094 /*  <lalVerbatim file="LALInspiralDerivativesCP"> */
00095 void 
00096 LALInspiralDerivatives (
00097    REAL8Vector *values,
00098    REAL8Vector *dvalues,
00099    void        *params
00100    )
00101  { /* </lalVerbatim> */
00102 
00103   InspiralDerivativesIn *ak;
00104   REAL8 v;
00105 
00106   ak = (InspiralDerivativesIn *) params;
00107   v = *(values->data);
00108 
00109   dvalues->data[0] = -ak->flux(v, ak->coeffs)/ (ak->totalmass*ak->dEnergy(v, ak->coeffs));
00110   dvalues->data[1] = 2.* v*v*v/ak->totalmass;
00111 
00112   return;
00113 }

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