LALInspiralParameterCalc.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, B.S. Sathyaprakash, Anand Sengupta, Thomas Cokelaer
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="LALInspiralParameterCalcCV">
00021 Author: Sathyaprakash, B. S.
00022 $Id: LALInspiralParameterCalc.c,v 1.26 2008/05/07 13:00:37 thomas Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralParameterCalc.c}}
00028 Given a pair of masses (or other equivalent parameters) compute
00029 related chirp parameters.
00030 
00031 \subsubsection*{Prototypes}
00032 \vspace{0.1in}
00033 \input{LALInspiralParameterCalcCP}
00034 \idx{LALInspiralParameterCalc()}
00035 \begin{itemize}
00036 \item\texttt{params:} Input/Output, given a pair of binary parameters and a lower
00037 frequency cutoff, other equivalent parameters are computed by this function.
00038 \end{itemize}
00039 
00040 \subsubsection*{Description}
00041 
00042 The code takes as its input {\tt params->fLower} in Hz and
00043 a pair of masses (in units of $M_\odot$) or chirptimes (in seconds measured from {\tt params->fLower})
00044 and computes all the other {\em mass} parameters in the {\tt params} structure. 
00045 Users choice of input pair of {\em masses} should be specified by appropriately setting 
00046 the variable {\tt params->massChoice} as described in the Table below:
00047 \begin{table}[h]
00048 \begin{center}
00049 \caption{For a given {\tt params->massChoice} in column 1 the user should specify the
00050 parameters as in column 2, in units as in column 3. Column 4 gives the conventional meaning
00051 of the parameters. Chirp times are measured from a lower frequency cutoff given
00052 in {\tt params->fLower.}}
00053 \begin{tabular}{cccc}
00054 \hline
00055 {\tt params->massChoice} & User should set & in units & which means \\
00056 \hline
00057 {\tt m1Andm2}         & ({\tt mass1, mass2})   & $(M_\odot, M_\odot)$          & $(m_1,m_2)$ \\ 
00058 {\tt totalMassAndEta} & ({\tt totalmass, eta}) & $(M_\odot, 0 < \eta \le 1/4)$ & $(m, \eta)$\\
00059 {\tt totalMassAndMu}  & ({\tt totalmass, mu})  & $(M_\odot, M_\odot)$          & $(m, \mu)$ \\ 
00060 {\tt t02}             & ({\tt t0, t2})         & (sec, sec) & $(\tau_0, \tau_2)$ \\
00061 {\tt t03}             & ({\tt t0, t3})         & (sec, sec) & $(\tau_0, \tau_3)$ \\
00062 {\tt t04}             & ({\tt t0, t4})         & (sec, sec) & $(\tau_0, \tau_4)$ \\
00063 \hline
00064 \end{tabular}
00065 \end{center}
00066 \end{table}
00067 
00068 If \texttt{massChoice} is not set properly an error condition will occur and
00069 the function is aborted with a return value 999.
00070 In the above list $m_{1}$ and $m_{2}$ are the masses of
00071 the two compact objects, $m=m_{1}+m_{2}$ is the total 
00072 mass, $\eta=m_{1}m_{2}/(m_{1}+m_{2})^{2}$ is the
00073 symmetric mass ratio, $\mu=m_{1}m_{2}/(m_{1}+m_{2})$ is 
00074 the reduced mass and $\tau$'s are the chirptimes
00075 defined in terms of $f_{a}$={\tt fLower} by:
00076 \begin{eqnarray}
00077 \tau_{0} = \frac{5}{256 \eta m^{5/3} (\pi f_{a})^{8/3}}, \ \ \ 
00078 \tau_{2} = \frac{(3715 + 4620 \eta)}{64512 \eta m (\pi f_{a})^{2}}, \ \ \ 
00079 \tau_{3} = \frac{\pi}{8 \eta m^{2/3} (\pi f_{a})^{5/3}}\nonumber \\ 
00080 \tau_{4} = \frac{5}{128 \eta m^{1/3} (\pi f_{a})^{4/3}} \left[ \frac{3058673}{1016064} +
00081 \frac{5429}{1008} \eta + \frac{617}{144} \eta^{2} \right],\ \ \ 
00082 \tau_5 = \frac {5}{256\eta f_a}  \left (\frac {7729}{252} + \eta \right ).
00083 \end{eqnarray}
00084 %% Beyond 2.5 PN order, chirp times do not have an 
00085 %% explicit expression in terms of the masses and $f_a.$
00086 Whichever pair of parameters is given to the function as an input, the function 
00087 calculates the rest.  Apart from the various masses and chirptimes the function
00088 also calculates the chirp mass $\mathcal{M}=(\mu^{3} m^{2})^{1/5}$ and 
00089 the total chirp time $\tau_C$ consistent with the approximation chosen: 
00090 \begin{table}[h]
00091 \begin{center}
00092 \caption{$t_C$ will be set according to the PN order chosen in {\tt params->approximant.}}
00093 \begin{tabular}{cccccc}
00094 \hline
00095 & {\tt Newtonian} & {\tt onePN} & {\tt onePointFivePN} & {\tt twoPN} & {\tt twoPointFivePN}\\
00096 \hline
00097   $\tau_C$
00098 & $\tau_0$ 
00099 & $\tau_0 + \tau_2$ 
00100 & $\tau_0 + \tau_2-\tau_3$ 
00101 & $\tau_0 + \tau_2-\tau_3 + \tau_4$ 
00102 & $\tau_0 + \tau_2-\tau_3 + \tau_4 - \tau_5$ \\
00103 \hline
00104 \end{tabular}
00105 \end{center}
00106 \end{table}
00107 
00108 \subsubsection*{Algorithm}
00109 Root finding by bisection method is used to solve for mass ratio $\eta$ when
00110 chirptimes $(\tau_0,\, \tau_2)$ or $(\tau_0,\, \tau_4)$ is input. 
00111 
00112 \subsubsection*{Uses}
00113 When appropriate this function calls:\\
00114 \texttt{
00115 LALDBisectionFindRoot\\
00116 LALEtaTau02\\
00117 LALEtaTau04\\
00118 }
00119 
00120 \subsubsection*{Notes}
00121 
00122 \vfill{\footnotesize\input{LALInspiralParameterCalcCV}}
00123 
00124 </lalLaTeX>  */
00125 
00126 
00127 
00128 #include <lal/LALInspiral.h>
00129 #include <lal/FindRoot.h>
00130 
00131 NRCSID (LALINSPIRALPARAMETERCALCC, "$Id: LALInspiralParameterCalc.c,v 1.26 2008/05/07 13:00:37 thomas Exp $");
00132 
00133 /*  <lalVerbatim file="LALInspiralParameterCalcCP"> */
00134 void 
00135 LALInspiralParameterCalc (
00136    LALStatus        *status, 
00137    InspiralTemplate *params
00138    )
00139 { /* </lalVerbatim> */
00140 
00141    REAL8 m1, m2, totalMass, eta, mu, piFl, etamin, tiny, ieta;
00142    REAL8 x1, x2, A0, A2, A3, A4, B2, B4, C4,v,tN;
00143    REAL8 theta = -11831.L/9240.L;
00144    REAL8 lambda = -1987.L/3080.L;
00145    static REAL8 oneby4;
00146    void *pars;
00147    DFindRootIn rootIn;
00148    EtaTau02In Tau2In;
00149    EtaTau04In Tau4In;
00150 
00151    INITSTATUS (status, "LALInspiralParameterCalc", LALINSPIRALPARAMETERCALCC );
00152    ATTATCHSTATUSPTR(status);
00153  
00154    ASSERT(params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00155    ASSERT((INT4)params->massChoice >= 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00156    ASSERT((INT4)params->massChoice <= 15, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00157 
00158    totalMass    = 0.0;
00159    ieta         = params->ieta;
00160    ieta         = 1.;
00161    oneby4       = 1./4.;
00162    etamin       = 1.e-10;
00163    tiny         = 1.e-10;
00164    piFl         = LAL_PI * params->fLower;
00165 
00166    switch(params->massChoice) 
00167    {
00168       case massesAndSpin:
00169       /*case spinOnly:*/
00170       case minmaxTotalMass:
00171       case m1Andm2:
00172       case fixedMasses:
00173 
00174          ASSERT(params->mass1 > 0.0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00175          ASSERT(params->mass2 > 0.0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00176 
00177          m1 = params->mass1;
00178          m2 = params->mass2;
00179          params->totalMass = totalMass = m1+m2;
00180          params->eta = eta = m1*m2/pow(totalMass,2);
00181          if (params->eta > oneby4) {
00182                  params->eta -= tiny;
00183          }
00184          params->mu = mu = m1*m2/totalMass;
00185          params->chirpMass = pow(mu,0.6)*pow(totalMass,0.4);
00186          params->psi0 = 3./128./params->eta
00187                         * 1. * pow((LAL_PI * params->totalMass * LAL_MTSUN_SI),-5./3.) ;
00188          params->psi3 = -3./128./params->eta
00189                         * (16 * LAL_PI) * pow((LAL_PI * params->totalMass * LAL_MTSUN_SI),-2./3.);
00190 
00191       break;
00192 
00193       case totalMassAndEta:
00194       case totalMassUAndEta:
00195 
00196          ASSERT(params->totalMass > 0.0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00197          ASSERT(params->eta > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00198          
00199          if (params->eta > oneby4) {
00200                 params->eta -= tiny;
00201         }
00202          ASSERT(params->eta <= oneby4, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00203          
00204          totalMass = params->totalMass;
00205          eta = params->eta;
00206          if (eta <= oneby4) {
00207             params->mass1 = 0.5*totalMass * ( 1.L + sqrt(1.L - 4.L*eta));
00208             params->mass2 = 0.5*totalMass * ( 1.L - sqrt(1.L - 4.L*eta));
00209          }
00210          params->mu = eta*totalMass;
00211          params->chirpMass = pow(eta,0.6)*totalMass;
00212 
00213       break;
00214 
00215       case totalMassAndMu:
00216 
00217          ASSERT(params->totalMass > 0.0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00218          ASSERT(params->mu > 0.0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00219          ASSERT(params->mu < params->totalMass, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00220          
00221          totalMass = params->totalMass;
00222          mu = params->mu;
00223          eta =  (params->mu)/totalMass;
00224          if (eta > oneby4) {
00225                  eta -= tiny;
00226          }
00227             params->eta = eta;
00228          if (eta <= oneby4) {
00229             params->mass1 = 0.5*totalMass * ( 1.L + sqrt(1.L - 4.L*eta));
00230             params->mass2 = 0.5*totalMass * ( 1.L - sqrt(1.L - 4.L*eta));
00231          }
00232          params->chirpMass = pow(eta,0.6)*totalMass;
00233          params->mu = eta*totalMass;
00234 
00235       break;
00236 
00237       case t02:
00238 
00239          ASSERT(params->t0 > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00240          ASSERT(params->t2 > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00241          
00242          A0 = 5./ pow(piFl, eightby3)/256.;
00243          A2 = 3715.0/(64512.0*pow(piFl,2.0));
00244          B2 = 4620.0/3715 * ieta;
00245          Tau2In.t2 = params->t2;
00246          Tau2In.A2 = A2 * pow(params->t0/A0, 0.6);
00247          Tau2In.B2 = B2;
00248          
00249          pars = (void *) &Tau2In;
00250          rootIn.function = &LALEtaTau02;
00251          rootIn.xmax = oneby4+tiny;
00252          rootIn.xmin = etamin;
00253          rootIn.xacc = 1.e-8;
00254          LALEtaTau02(status->statusPtr, &x1, rootIn.xmax, pars);
00255          CHECKSTATUSPTR(status);
00256          LALEtaTau02(status->statusPtr, &x2, rootIn.xmin, pars);
00257          CHECKSTATUSPTR(status);
00258          
00259          if (x1*x2 > 0) {
00260             params->eta = 0.;
00261             DETATCHSTATUSPTR(status);
00262             RETURN(status);
00263          } else {
00264             LALDBisectionFindRoot(status->statusPtr, &eta, &rootIn, pars);
00265             CHECKSTATUSPTR(status);
00266          }
00267          if (eta > oneby4) {
00268                  eta-=tiny;
00269         }
00270          params->eta = eta;
00271          totalMass = pow(A0/(eta*params->t0), 0.6);
00272          totalMass = params->totalMass = totalMass/LAL_MTSUN_SI;
00273          if (eta <= oneby4) {
00274             params->mass1 = 0.5*totalMass * ( 1.L + sqrt(1.L - 4.L*eta));
00275             params->mass2 = 0.5*totalMass * ( 1.L - sqrt(1.L - 4.L*eta));
00276          }
00277          params->chirpMass = pow(eta,0.6)*totalMass;
00278          params->mu = eta*totalMass;
00279 
00280       break;
00281 
00282       case t03:
00283 
00284          ASSERT(params->t0 > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00285          ASSERT(params->t3 > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00286          
00287          A0 = 5./ pow(piFl, eightby3)/256.;
00288          A3 = LAL_PI / pow(piFl, fiveby3)/8.;
00289          totalMass = A0 * params->t3/(A3 * params->t0);
00290          eta = A0/(params->t0 * pow(totalMass, fiveby3));
00291          
00292          if (eta > oneby4) {
00293                  eta-=tiny;
00294          }
00295          params->eta = eta;
00296          totalMass = params->totalMass = totalMass/LAL_MTSUN_SI;
00297          if (eta <= oneby4) {
00298             params->mass1 = 0.5*totalMass * ( 1.L + sqrt(1.L - 4.L*eta));
00299             params->mass2 = 0.5*totalMass * ( 1.L - sqrt(1.L - 4.L*eta));
00300          }
00301          params->chirpMass = pow(eta,0.6)*totalMass;
00302          params->mu = eta*totalMass;
00303 
00304       break;
00305  
00306       case t04:
00307 
00308          ASSERT(params->t0 > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00309          ASSERT(params->t4 > 0., status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00310 
00311          A0 = 5./(256. * pow(piFl, eightby3));
00312          A4 = 5./(128.0 * pow(piFl,fourby3)) * 3058673./1016064.;
00313          B4 = 5429./1008 * 1016064./3058673. * ieta;
00314          C4 = 617./144. * 1016064./3058673. * ieta;
00315          Tau4In.t4 = params->t4;
00316          Tau4In.A4 = A4 * pow(params->t0/A0, 0.2);
00317          Tau4In.B4 = B4;
00318          Tau4In.C4 = C4;
00319 
00320          pars = (void *) &Tau4In;
00321          rootIn.function = &LALEtaTau04;
00322          rootIn.xmax = oneby4+tiny;
00323          rootIn.xmin = etamin;
00324          rootIn.xacc = 1.e-8;
00325          LALEtaTau04(status->statusPtr, &x1, rootIn.xmax, pars);
00326          CHECKSTATUSPTR(status);
00327          LALEtaTau04(status->statusPtr, &x2, rootIn.xmin, pars);
00328          CHECKSTATUSPTR(status);
00329 
00330          if (x1*x2 > 0) {
00331             params->eta = 0.;
00332             DETATCHSTATUSPTR(status);
00333             RETURN(status);
00334          } else {
00335             LALDBisectionFindRoot(status->statusPtr, &eta, &rootIn, pars);
00336             CHECKSTATUSPTR(status);
00337          }
00338          if (eta > oneby4) {
00339                  eta-=tiny;
00340          }
00341          params->eta = eta;
00342          totalMass = pow(A0/(eta*params->t0), 0.6);
00343          totalMass = params->totalMass = totalMass/LAL_MTSUN_SI;
00344          if (eta <= oneby4) {
00345             params->mass1 = 0.5*totalMass * ( 1.L + sqrt(1.L - 4.L*eta));
00346             params->mass2 = 0.5*totalMass * ( 1.L - sqrt(1.L - 4.L*eta));
00347          }
00348          params->chirpMass = pow(eta,0.6)*totalMass;
00349          params->mu = eta*totalMass;
00350 
00351       break;
00352 
00353      
00354       case psi0Andpsi3:
00355       if (params->psi0 > 0 && params->psi3 < 0)
00356       {
00357               params->totalMass = totalMass = -params->psi3/(16.L * LAL_PI * LAL_PI * params->psi0)/LAL_MTSUN_SI;
00358               params->eta = eta = 3.L/(128.L * params->psi0 * pow (LAL_PI * totalMass*LAL_MTSUN_SI, fiveby3));
00359                       
00360               /* if eta < 1/4 amd M > 0 then physical values*/
00361               if (eta <= oneby4) 
00362               {
00363                       params->mass1 = 0.5*totalMass * ( 1.L + sqrt(1.L - 4.L*eta));
00364                       params->mass2 = 0.5*totalMass * ( 1.L - sqrt(1.L - 4.L*eta));
00365                       params->mu = eta*totalMass;
00366                       params->chirpMass = pow(eta,0.6)*totalMass;
00367               }
00368       }
00369       else 
00370       {
00371               params->eta = 0.;
00372               DETATCHSTATUSPTR(status);
00373               RETURN(status);
00374       }
00375       break;
00376 
00377      default:
00378       ABORT (status, 999, "Improper choice for massChoice in LALInspiralParameterCalc\n");
00379       break;
00380    }
00381    
00382    if (params->eta > oneby4) {
00383            params->eta-=tiny;
00384         }
00385    totalMass    = totalMass*LAL_MTSUN_SI;
00386 
00387    /* Should use the coefficients from LALInspiraSetup.c to avoid errors. 
00388     * */
00389    v = pow(piFl * totalMass, 1.L/3.L);
00390    tN = 5.L/256.L / eta * totalMass / pow(v,8.L);
00391    
00392    params->t0   = 5.0L/(256.0L*eta*pow(totalMass,fiveby3)*pow(piFl,eightby3));
00393    params->t2   = (3715.0L + (4620.0L*ieta*eta))/(64512.0*eta*totalMass*pow(piFl,2.0));
00394    params->t3   = LAL_PI/(8.0*eta*pow(totalMass,twoby3)*pow(piFl,fiveby3));
00395    params->t4   = (5.0/(128.0*eta*pow(totalMass,oneby3)*pow(piFl,fourby3)))
00396                 * (3058673./1016064. + 5429.*ieta*eta/1008. +617.*ieta*eta*eta/144.);
00397    params->t5   = -5.*(7729./252. - 13./3.*ieta*eta)/(256.*eta*params->fLower);
00398    /* This is a ddraft. t6 and t7 need to be checked propely*/
00399    params->t6 =  -10052469856691./23471078400. + 128./3.*LAL_PI*LAL_PI
00400      +(15335597827.L/15240960.L-451.L/12.L*LAL_PI*LAL_PI+352./3.*theta-2464.L/9.L*lambda)*ieta*eta
00401      +6848.L/105.L* LAL_GAMMA
00402      -15211.L/1728.L*ieta*eta*eta+25565.L/1296.L*eta*eta*eta*ieta;
00403    params->t6 = tN * (params->t6  + 6848.L/105.L*log(4.*v)) * pow(v,6);    
00404    params->t7 = (-15419335.L/127008.L-75703.L/756.L*ieta*eta+14809.L/378.L*ieta*eta*eta) * LAL_PI * tN * pow(v,7);
00405      
00406    params->psi0 = 3.L/(128.L * eta * pow(LAL_PI * totalMass, fiveby3));
00407    params->psi3 = -3.L * LAL_PI/(8.L * eta * pow(LAL_PI * totalMass, twoby3));
00408    
00409    switch (params->order) {
00410                         
00411       case newtonian:
00412       case oneHalfPN:
00413          params->t2=0.0;
00414 /*       params->t3=0.0;*/        
00415          params->t4=0.0;
00416          params->t5=0.0;
00417          params->t6=0.0;
00418          params->t7=0.0;
00419          params->tC = params->t0;
00420       break;
00421 
00422       case onePN:
00423          params->t3=0.0;
00424          params->t4=0.0;
00425          params->t5=0.0;
00426          params->t6=0.0;
00427          params->t7=0.0;
00428          params->tC = params->t0 + params->t2;
00429       break;
00430 
00431       case onePointFivePN:
00432          params->t4=0.0;
00433          params->t5=0.0;
00434          params->t6=0.0;
00435          params->t7=0.0;
00436          params->tC = params->t0 + params->t2 - params->t3;
00437       break;
00438 
00439       case twoPN:
00440          params->t5=0.0;
00441          params->t6=0.0;
00442          params->t7=0.0;
00443          params->tC = params->t0 + params->t2 - params->t3 + params->t4;
00444       break;
00445 
00446       case twoPointFivePN:
00447          params->t6 = 0.0;
00448          params->t7 = 0.0;
00449          params->tC = params->t0 + params->t2 - params->t3 + params->t4 - params->t5;
00450       
00451       case threePN:
00452          /*check the initialisation and then comment the next line. For now we
00453           * set t6=0*/
00454          params->t6 = 0;
00455          params->t7 = 0.0;
00456          params->tC = params->t0 + params->t2 - params->t3 + params->t4 - params->t5 + params->t6;
00457       
00458       case threePointFivePN:
00459       default:
00460          /*check the initialisation and then comment the next line. For now we
00461           * set t6=0 and t7=0*/
00462          params->t6 = 0;
00463          params->t7 = 0.0;
00464          params->tC = params->t0 + params->t2 - params->t3 + params->t4 - params->t5 + params->t6 - params->t7;
00465       break;
00466    }
00467 
00468    DETATCHSTATUSPTR(status);
00469    RETURN(status);
00470 }
00471 
00472 

Generated on Fri Aug 29 02:48:58 2008 for LAL by  doxygen 1.5.2