Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALSpinPrecHcapRvecDerivative_v3opt.c
Go to the documentation of this file.
1#ifndef _LALSPINPRECHCAPRVECDERIVATIVE_V3OPT_C
2#define _LALSPINPRECHCAPRVECDERIVATIVE_V3OPT_C
3
4#include <stdio.h>
5#include <math.h>
6
7#include <lal/LALSimInspiral.h>
8#include <lal/LALSimIMR.h>
9
10#include "LALSimIMRSpinEOB.h"
12
13/**
14 * Function to calculate exact derivatives of the spin EOB Hamiltonian,
15 * to get \f$dr/dt\f$, as decribed in Eqs. A4 of PRD 81, 084041 (2010)
16 * This function is not used by the spin-aligned SEOBNRv1 model.
17 */
19 double UNUSED t, /**<< UNUSED */
20 const REAL8 values[], /**<< Dynamical variables */
21 REAL8 dvalues[], /**<< Time derivatives of variables (returned) */
22 void *funcParams /**<< EOB parameters */
23 )
24{
25 for(int i =0; i < 12; i++){
26 if( isnan(values[i]) ) {
27 XLAL_PRINT_INFO("XLALSpinPrecHcapRvecDerivative_exact::values %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f %3.10f\n", values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11]);
28 XLALPrintError( "XLAL Error - %s: nan in input values \n", __func__);
30 }
31 }
32 SpinEOBParams * seobParams = (SpinEOBParams *)funcParams;
33
34 REAL8 tmpDValues[12] = {0.}, Tmatrix[3][3]={{0.,0.,0.},{0.,0.,0.},{0.,0.,0.}};
35 seobParams->seobCoeffs->updateHCoeffs = 1;
36
37 /* OPTv3: First, find csi and rMag2 for Tmatrix */
38 REAL8 csi=1.0, rMag2;
39 rMag2 = values[0]*values[0] + values[1]*values[1] + values[2]*values[2];
40 if ( seobParams->tortoise ){
41 REAL8 a2, rMag, u, u2, u3, u4, u5, w2, D, m1PlusetaKK, bulk, logTerms, deltaU, deltaT, deltaR, eta;
42 REAL8 sKerr[3] = {0.};
43
44 eta=seobParams->eobParams->eta;
45 SpinEOBHCoeffs * coeffs = seobParams->seobCoeffs;
46
47 a2=0.;
48 for(int i=0; i<3; i++){
49 sKerr[i] = values[i+6] + values[i+9];
50 a2 += sKerr[i]*sKerr[i];
51 }
52
53 rMag = sqrt(rMag2);
54
55 u = 1./rMag;
56 u2 = 1./rMag2;
57 u3 = u2*u;
58 u4 = u2*u2;
59 u5 = u4*u;
60 w2 = rMag2 + a2;
61
62 /* Eq. 5.83 of Barausse and Buonanno PRD 81, 084024 (2010) (hereafter BB1), inverse */
63 D = 1. + log(1. + 6.*eta*u2 + 2.*(26. - 3.*eta)*eta*u3);
64
65 m1PlusetaKK = -1. + eta * coeffs->KK;
66
67 /* Eq. 5.75 of BB1 */
69
70 /* Eq. 5.73 of BB1 */
71 logTerms = 1. + eta*coeffs->k0 + eta*log(fabs(1. + coeffs->k1*u
72 + coeffs->k2*u2 + coeffs->k3*u3 + coeffs->k4*u4
73 + coeffs->k5*u5 + coeffs->k5l*u5*log(u)));
74
75 /* Eq. 5.73 of BB1 */
76 deltaU = fabs(bulk*logTerms);
77
78 /* Eq. 5.71 of BB1 */
79 deltaT = rMag2*deltaU;
80
81 /* Eq. 5.38 of BB1 */
82 deltaR = deltaT*D;
83
84 csi = sqrt( fabs(deltaT * deltaR) )/ w2; /* Inverse of Eq. 28 of Pan et al. PRD 81, 084041 (2010), so that csi = \xi_a(R) */
85
87 }
88
89 /* Calculate the T-matrix, required to convert P from tortoise to
90 * non-tortoise coordinates, and/or vice-versa. This is given explicitly
91 * in Eq. A3 of Pan et al. PRD 81, 084041 (2010) */
92 for( int i = 0; i < 3; i++ ){
93 for( int j = 0; j <= i; j++ )
94 Tmatrix[i][j] = Tmatrix[j][i] = (values[i]*values[j]/rMag2)* (csi - 1.);
95 Tmatrix[i][i]++;
96 }
97
98 REAL8 Pderivs[3]={0.};
99 XLALSEOBNRv3_opt_HDerivs_for_Omega(values,seobParams->eobParams->m1,seobParams->eobParams->m2,seobParams->eobParams->eta,seobParams->seobCoeffs,Pderivs,seobParams);
100 tmpDValues[3] = Pderivs[0];
101 tmpDValues[4] = Pderivs[1];
102 tmpDValues[5] = Pderivs[2];
103
104 {
105 /* SEOBNRv3_opt: The following updates hcoeffs */
106 REAL8 mass1 = seobParams->eobParams->m1;
107 REAL8 mass2 = seobParams->eobParams->m2;
108 REAL8 s1Data[3],s2Data[3], rcrossrDot[3];
109 REAL8 rcrossrDotMag, s1dotLN, s2dotLN, chiS,chiA, tplspin;
110 memcpy(s1Data,values+6,3*sizeof(REAL8));
111 memcpy(s2Data,values+9,3*sizeof(REAL8));
112 for ( int i = 0; i < 3; i++ )
113 {
114 s1Data[i] *= (mass1+mass2)*(mass1+mass2);
115 s2Data[i] *= (mass1+mass2)*(mass1+mass2);
116 }
117
118 // Compute \vec{L_N} = \vec{r} \times \dot{\vec{r}}, \vec{S_i} \cdot \vec{L_N} and chiS and chiA
119 rcrossrDot[0] = values[1]*tmpDValues[5] - values[2]*tmpDValues[4];
120 rcrossrDot[1] = values[2]*tmpDValues[3] - values[0]*tmpDValues[5];
121 rcrossrDot[2] = values[0]*tmpDValues[4] - values[1]*tmpDValues[3];
122 rcrossrDotMag = sqrt( rcrossrDot[0]*rcrossrDot[0] + rcrossrDot[1]*rcrossrDot[1] + rcrossrDot[2]*rcrossrDot[2] );
123 rcrossrDot[0] /= rcrossrDotMag;
124 rcrossrDot[1] /= rcrossrDotMag;
125 rcrossrDot[2] /= rcrossrDotMag;
126 s1dotLN = (s1Data[0]*rcrossrDot[0] + s1Data[1]*rcrossrDot[1] + s1Data[2]*rcrossrDot[2])/ (mass1*mass1);
127 s2dotLN = (s2Data[0]*rcrossrDot[0] + s2Data[1]*rcrossrDot[1] + s2Data[2]*rcrossrDot[2])/ (mass2*mass2) ;
128 chiS = 0.5 * (s1dotLN + s2dotLN);
129 chiA = 0.5 * (s1dotLN - s2dotLN);
130 /* Compute the Kerr spin parameter for the test particle; equivalent to Equation 31 of PRD 86, 024011(2012) */
131 tplspin = (1.-2.*seobParams->eobParams->eta) * chiS + (mass1 - mass2)/(mass1 + mass2) * chiA;
132
133 XLALSimIMREOBCalcSpinPrecFacWaveformCoefficients(seobParams->eobParams->hCoeffs, mass1, mass2, seobParams->eobParams->eta, tplspin,chiS, chiA, 3);
134 }
135
136 /* Now make the conversion */
137 /* rVectorDot */
138 for( int i = 0; i < 3; i++ ){
139 dvalues[i]=0.;
140 for( int j = 0.; j < 3; j++ )
141 dvalues[i] += tmpDValues[j+3]*Tmatrix[i][j];
142 }
143
144 /* Now check for NaNs in the dvalues[] output array; only elements 0, 1, and 2 are set */
145 for(int i = 0; i < 3; i++ ){
146 if( isnan(dvalues[i]) ) {
147 XLAL_PRINT_INFO("XLALSpinPrecHcapRvecDerivative_exact::dvalues %3.10f %3.10f %3.10f\n", dvalues[0], dvalues[1], dvalues[2]);
148 XLALPrintError( "XLAL Error - %s: nan in the output dvalues \n", __func__);
150 }
151 }
152
153
154 return XLAL_SUCCESS;
155}
156
157#endif //_LALSPINPRECHCAPRVECDERIVATIVE_C
static int XLALSimIMRCalculateSpinPrecEOBHCoeffs(SpinEOBHCoeffs *coeffs, const REAL8 eta, const REAL8 a, const UINT4 SpinAlignedEOBversion)
This function is used to calculate some coefficients which will be used in the spinning EOB Hamiltoni...
static int XLALSimIMREOBCalcSpinPrecFacWaveformCoefficients(FacWaveformCoeffs *const coeffs, const REAL8 m1, const REAL8 m2, const REAL8 eta, const REAL8 a, const REAL8 chiS, const REAL8 chiA, const UINT4 SpinAlignedEOBversion)
Waveform expressions are given by Taracchini et al.
static INT4 XLALSEOBNRv3_opt_HDerivs_for_Omega(const REAL8 *valuestort, const REAL8 mass1, const REAL8 mass2, const REAL8 eta, SpinEOBHCoeffs *coeffs, REAL8 *derivs, SpinEOBParams *params)
static int XLALSpinPrecHcapRvecDerivative_exact(double UNUSED t, const REAL8 values[], REAL8 dvalues[], void *funcParams)
Function to calculate exact derivatives of the spin EOB Hamiltonian, to get , as decribed in Eqs.
double i
Definition: bh_ringdown.c:118
const double deltaU
const double deltaR
const double u
const double w2
const double u3
const double bulk
const double u5
const double a2
const double m1PlusetaKK
const double u2
const double u4
const double csi
const double logTerms
double REAL8
#define XLAL_PRINT_INFO(...)
#define XLAL_ERROR(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EINVAL
FacWaveformCoeffs * hCoeffs
Parameters for the spinning EOB model, used in calculating the Hamiltonian.
UINT4 SpinAlignedEOBversion
Parameters for the spinning EOB model.
SpinEOBHCoeffs * seobCoeffs
EOBParams * eobParams
double deltaT
Definition: unicorn.c:24