Exemple #1
0
static void T4wdot_from_pncoefficients(
    PNPhasingSeries *wdot,
    const REAL8 m1M,
    const REAL8 chi1,
    const REAL8 chi2,
    const REAL8 qm_def1,
    const REAL8 qm_def2
    )
{
    REAL8 m2M = 1.-m1M;
    REAL8 eta = m1M*m2M;
    /* Spins use the wacky lal convention */
    REAL8 S1L = m1M*m1M*chi1;
    REAL8 S2L = m2M*m2M*chi2;

    memset(wdot, 0, sizeof(PNPhasingSeries));
    wdot->v[0] = XLALSimInspiralTaylorT4wdot_0PNCoeff(eta);
    wdot->v[1] = 0.;
    wdot->v[2] = XLALSimInspiralTaylorT4wdot_2PNCoeff(eta);
    wdot->v[3] = XLALSimInspiralTaylorT4wdot_3PNCoeff(eta);
    wdot->v[4] = XLALSimInspiralTaylorT4wdot_4PNCoeff(eta);
    wdot->v[5] = XLALSimInspiralTaylorT4wdot_5PNCoeff(eta);
    wdot->v[6] = XLALSimInspiralTaylorT4wdot_6PNCoeff(eta);
    wdot->vlogv[6] = XLALSimInspiralTaylorT4wdot_6PNLogCoeff(eta);
    wdot->v[7] = XLALSimInspiralTaylorT4wdot_7PNCoeff(eta);
    wdot->v[8] = 0.;

    wdot->v[3] += XLALSimInspiralTaylorT4wdot_3PNSOCoeff(m1M)*S1L + XLALSimInspiralTaylorT4wdot_3PNSOCoeff(m2M)*S2L;
    wdot->v[5] += XLALSimInspiralTaylorT4wdot_5PNSOCoeff(m1M)*S1L + XLALSimInspiralTaylorT4wdot_5PNSOCoeff(m2M)*S2L;
    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNSOCoeff(m1M)*S1L + XLALSimInspiralTaylorT4wdot_6PNSOCoeff(m2M)*S2L;
    wdot->v[7] += XLALSimInspiralTaylorT4wdot_7PNSOCoeff(m1M)*S1L + XLALSimInspiralTaylorT4wdot_7PNSOCoeff(m2M)*S2L;
    wdot->v[8] += XLALSimInspiralTaylorT4wdot_8PNSOCoeff(m1M)*S1L + XLALSimInspiralTaylorT4wdot_8PNSOCoeff(m2M)*S2L;

    wdot->v[4] += XLALSimInspiralTaylorT4wdot_4PNS1S2Coeff(eta)*S1L*S2L;
    wdot->v[4] += XLALSimInspiralTaylorT4wdot_4PNS1S2OCoeff(eta)*S1L*S2L;
    wdot->v[4] += XLALSimInspiralTaylorT4wdot_4PNSelf2SCoeff(m1M)*S1L*S1L;
    wdot->v[4] += XLALSimInspiralTaylorT4wdot_4PNSelf2SOCoeff(m1M)*S1L*S1L;
    wdot->v[4] += XLALSimInspiralTaylorT4wdot_4PNSelf2SCoeff(m2M)*S2L*S2L;
    wdot->v[4] += XLALSimInspiralTaylorT4wdot_4PNSelf2SOCoeff(m2M)*S2L*S2L;
    wdot->v[4] += qm_def1*XLALSimInspiralTaylorT4wdot_4PNQM2SCoeff(m1M)*S1L*S1L;
    wdot->v[4] += qm_def1*XLALSimInspiralTaylorT4wdot_4PNQM2SOCoeff(m1M)*S1L*S1L;
    wdot->v[4] += qm_def2*XLALSimInspiralTaylorT4wdot_4PNQM2SCoeff(m2M)*S2L*S2L;
    wdot->v[4] += qm_def2*XLALSimInspiralTaylorT4wdot_4PNQM2SOCoeff(m2M)*S2L*S2L;

    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNS1S2Coeff(eta)*S1L*S2L;
    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNS1S2OCoeff(eta)*S1L*S2L;
    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNSelf2SCoeff(m1M)*S1L*S1L;
    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNSelf2SOCoeff(m1M)*S1L*S1L;
    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNSelf2SCoeff(m2M)*S2L*S2L;
    wdot->v[6] += XLALSimInspiralTaylorT4wdot_6PNSelf2SOCoeff(m2M)*S2L*S2L;
    wdot->v[6] += qm_def1*XLALSimInspiralTaylorT4wdot_6PNQM2SCoeff(m1M)*S1L*S1L;
    wdot->v[6] += qm_def1*XLALSimInspiralTaylorT4wdot_6PNQM2SOCoeff(m1M)*S1L*S1L;
    wdot->v[6] += qm_def2*XLALSimInspiralTaylorT4wdot_6PNQM2SCoeff(m2M)*S2L*S2L;
    wdot->v[6] += qm_def2*XLALSimInspiralTaylorT4wdot_6PNQM2SOCoeff(m2M)*S2L*S2L;

    return;
}
/**
 * Set up the expnCoeffsTaylorT4 and expnFuncTaylorT4 structures for
 * generating a TaylorT4 waveform and select the post-newtonian
 * functions corresponding to the desired order.
 *
 * Inputs given in SI units.
 */
static int 
XLALSimInspiralTaylorT4Setup(
    expnCoeffsTaylorT4 *ak,         /**< coefficients for TaylorT4 evolution [modified] */
    expnFuncTaylorT4 *f,            /**< functions for TaylorT4 evolution [modified] */
    expnCoeffsdEnergyFlux *akdEF,   /**< coefficients for Energy calculation [modified] */
    REAL8 m1,                       /**< mass of companion 1 */
    REAL8 m2,                       /**< mass of companion 2 */
    REAL8 lambda1,                  /**< (tidal deformability of body 1)/(mass of body 1)^5 */
    REAL8 lambda2,                  /**< (tidal deformability of body 2)/(mass of body 2)^5 */
    LALSimInspiralTidalOrder tideO,	/**< twice PN order of tidal effects */
    int O                           /**< twice post-Newtonian order */
)
{
    ak->m1 = m1;
    ak->m2 = m2;
    ak->m = ak->m1 + ak->m2;
    ak->mu = m1 * m2 / ak->m;
    ak->nu = ak->mu/ak->m;
    ak->chi1 = ak->m1/ak->m;
    ak->chi2 = ak->m2/ak->m;

    /* Angular velocity co-efficient */
    ak->av = pow(LAL_C_SI, 3.0)/(LAL_G_SI*ak->m);

    /* PN co-efficients for energy */
    akdEF->ETaN = XLALSimInspiralPNEnergy_0PNCoeff(ak->nu);
    akdEF->ETa1 = XLALSimInspiralPNEnergy_2PNCoeff(ak->nu);
    akdEF->ETa2 = XLALSimInspiralPNEnergy_4PNCoeff(ak->nu);
    akdEF->ETa3 = XLALSimInspiralPNEnergy_6PNCoeff(ak->nu);

    /* PN co-efficients for angular acceleration */
    ak->aatN = XLALSimInspiralTaylorT4wdot_0PNCoeff(ak->nu)/(ak->m/LAL_MSUN_SI*LAL_MTSUN_SI)/3.;
    ak->aat2 = XLALSimInspiralTaylorT4wdot_2PNCoeff(ak->nu);
    ak->aat3 = XLALSimInspiralTaylorT4wdot_3PNCoeff(ak->nu);
    ak->aat4 = XLALSimInspiralTaylorT4wdot_4PNCoeff(ak->nu);
    ak->aat5 = XLALSimInspiralTaylorT4wdot_5PNCoeff(ak->nu);
    ak->aat6 = XLALSimInspiralTaylorT4wdot_6PNCoeff(ak->nu);
    ak->aat7 = XLALSimInspiralTaylorT4wdot_7PNCoeff(ak->nu);
    ak->aat6l = XLALSimInspiralTaylorT4wdot_6PNLogCoeff(ak->nu);

    /* Tidal coefficients for energy and angular acceleration */
    akdEF->ETa5 = 0.;
    akdEF->ETa6 = 0.;
    ak->aat10   = 0.;
    ak->aat12   = 0.;
    switch( tideO )
    {
        case LAL_SIM_INSPIRAL_TIDAL_ORDER_ALL:
        case LAL_SIM_INSPIRAL_TIDAL_ORDER_6PN:
            akdEF->ETa6 = lambda1 * XLALSimInspiralPNEnergy_12PNTidalCoeff(ak->chi1) + lambda2 * XLALSimInspiralPNEnergy_12PNTidalCoeff(ak->chi2);
            ak->aat12   = lambda1 * XLALSimInspiralTaylorT4wdot_12PNTidalCoeff(ak->chi1) + lambda2 * XLALSimInspiralTaylorT4wdot_12PNTidalCoeff(ak->chi2);
        case LAL_SIM_INSPIRAL_TIDAL_ORDER_5PN:
            akdEF->ETa5 = lambda1 * XLALSimInspiralPNEnergy_10PNTidalCoeff(ak->chi1) + lambda2 * XLALSimInspiralPNEnergy_10PNTidalCoeff(ak->chi2);
            ak->aat10   = lambda1 * XLALSimInspiralTaylorT4wdot_10PNTidalCoeff(ak->chi1) + lambda2 * XLALSimInspiralTaylorT4wdot_10PNTidalCoeff(ak->chi2);
        case LAL_SIM_INSPIRAL_TIDAL_ORDER_0PN:
            break;
        default:
            XLALPrintError("XLAL Error - %s: Invalid tidal PN order %d\nSee LALSimInspiralTidalOrder enum in LALSimInspiralWaveformFlags.h for valid tidal orders.\n",
                    __func__, tideO );
            XLAL_ERROR(XLAL_EINVAL);
            break;
    }

    switch (O)
    {
        case 0:
            f->energy4 = &XLALSimInspiralEt0;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_0PN;
            break;
        case 1:
            XLALPrintError("XLAL Error - %s: PN approximant not supported for PN order %d\n", __func__,O);
            XLAL_ERROR(XLAL_EINVAL);
            break;
        case 2:
            f->energy4 = &XLALSimInspiralEt2;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_2PN;
            break;
        case 3:
            f->energy4 = &XLALSimInspiralEt2;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_3PN;
            break;
        case 4:
            f->energy4 = &XLALSimInspiralEt4;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_4PN;
            break;
        case 5:
            f->energy4 = &XLALSimInspiralEt4;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_5PN;
            break;
        case 6:
            f->energy4 = &XLALSimInspiralEt6;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_6PN;
            break;
        case 7:
        case -1:
            f->energy4 = &XLALSimInspiralEt6;
            f->angacc4 = &XLALSimInspiralAngularAcceleration4_7PN;
            break;
        case 8:
            XLALPrintError("XLAL Error - %s: PN approximant not supported for PN order %d\n", __func__,O);
            XLAL_ERROR(XLAL_EINVAL);
            break;
        default:
            XLALPrintError("XLAL Error - %s: Unknown PN order in switch\n", __func__);
            XLAL_ERROR(XLAL_EINVAL);
    }
  
  return 0;
}