LALSimulation  5.4.0.1-fe68b98
LALSimIMRSpinEOBHcapNumericalDerivative.c
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2010 Craig Robinson, Yi Pan
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 
20 
21 /**
22  * \author Craig Robinson, Yi Pan
23  *
24  * \brief In newer versions of the EOBNR approximant, we
25  * do not have an analytic expression for the derivative of the waveform.
26  * As such, it is necessary to calculate the derivatives numerically. This
27  * function provides the means to do just that.
28  *
29  */
30 
31 #ifndef _LALSIMIMRSPINEOBHCAPNUMERICALDERIVATIVE_C
32 #define _LALSIMIMRSPINEOBHCAPNUMERICALDERIVATIVE_C
33 
34 #ifdef __GNUC__
35 #define UNUSED __attribute__ ((unused))
36 #else
37 #define UNUSED
38 #endif
39 
40 #include <math.h>
41 #include <gsl/gsl_deriv.h>
42 #include <lal/LALSimInspiral.h>
43 #include <lal/LALSimIMR.h>
44 
45 #include "LALSimIMRSpinEOB.h"
46 
51 
52 //int UsePrec = 1;
53 
54 /*------------------------------------------------------------------------------------------
55  *
56  * Prototypes of functions defined in this code.
57  *
58  *------------------------------------------------------------------------------------------
59  */
60 
61 
62 static double GSLSpinHamiltonianWrapper( double x, void *params );
63 
65  double t,
66  const REAL8 values[],
67  REAL8 dvalues[],
68  void *funcParams
69  ) UNUSED;
70 
72  const INT4 paramIdx,
73  const REAL8 values[],
75  );
76 
77 
78 /*------------------------------------------------------------------------------------------
79  *
80  * Defintions of functions.
81  *
82  *------------------------------------------------------------------------------------------
83  */
84 
85 /**
86  * Function to calculate numerical derivatives of the spin EOB Hamiltonian,
87  * which correspond to time derivatives of the dynamical variables in conservative dynamcis.
88  * All derivatives, including those on two terms of the orbital phase, are returned together.
89  * The derivatives are combined with energy flux to give right hand side of the ODEs
90  * of a generic spin EOB model, as decribed in Eqs. 21, 22, 26 and 27 of
91  * Pan et al. PRD 81, 084041 (2010)
92  * This function is not used by the spin-aligned SEOBNRv1 model.
93  */
95  double UNUSED t, /**<< UNUSED */
96  const REAL8 values[], /**<< Dynamical variables */
97  REAL8 dvalues[], /**<< Time derivatives of variables (returned) */
98  void *funcParams /**<< EOB parameters */
99  )
100 {
101 
102  static const REAL8 STEP_SIZE = 1.0e-4;
103 
104  static const INT4 lMax = 8;
105 
107 
108  /* Since we take numerical derivatives wrt dynamical variables */
109  /* but we want them wrt time, we use this temporary vector in */
110  /* the conversion */
111  REAL8 tmpDValues[14];
112 
113  REAL8 H; //Hamiltonian
114  REAL8 flux;
115 
116  gsl_function F;
117  INT4 gslStatus;
118  UINT4 SpinAlignedEOBversion;
119  UINT4 i;
120 
121  REAL8Vector rVec, pVec;
122  REAL8 rData[3], pData[3];
123 
124  /* We need r, phi, pr, pPhi to calculate the flux */
125  REAL8 r;
126  REAL8Vector polarDynamics;
127  REAL8 polData[4];
128 
129  REAL8 mass1, mass2, eta;
130  REAL8 rrTerm2, pDotS1, pDotS2;
131  REAL8Vector s1, s2, s1norm, s2norm, sKerr, sStar;
132  REAL8 s1Data[3], s2Data[3], s1DataNorm[3], s2DataNorm[3];
133  REAL8 sKerrData[3], sStarData[3];
134  //REAL8 magS1, magS2, chiS, chiA, a;
135 
136 
137  /* Orbital angular momentum */
138  REAL8 Lx, Ly, Lz, magL;
139  REAL8 Lhatx, Lhaty, Lhatz;
140  REAL8 dLx, dLy, dLz;
141  REAL8 dLhatx, dLhaty, dMagL;
142 
143  REAL8 alphadotcosi;
144 
145  REAL8 rCrossV_x, rCrossV_y, rCrossV_z, omega;
146 
147  /* The error in a derivative as measured by GSL */
148  REAL8 absErr;
149 
150  /* NQC coefficients container */
151  EOBNonQCCoeffs *nqcCoeffs = NULL;
152 
153  /* Set up pointers for GSL */
154  params.values = values;
155  params.params = (SpinEOBParams *)funcParams;
156  nqcCoeffs = params.params->nqcCoeffs;
157 
158  F.function = &GSLSpinHamiltonianWrapper;
159  F.params = &params;
160 
161  mass1 = params.params->eobParams->m1;
162  mass2 = params.params->eobParams->m2;
163  eta = params.params->eobParams->eta;
164  SpinAlignedEOBversion = params.params->seobCoeffs->SpinAlignedEOBversion;
165 
166  /* For precessing binaries, the effective spin of the Kerr
167  * background evolves with time. The coefficients used to compute
168  * the Hamiltonian depend on the Kerr spin, and hence need to
169  * be updated for the current spin values */
170  if (UsePrec)
171  {
172  /* Set up structures and calculate necessary (spin-only) PN parameters */
173  /* Due to precession, these need to get calculated in every step */
174  memset( params.params->seobCoeffs, 0, sizeof(SpinEOBHCoeffs) );
175 
176  REAL8 tmps1Data[3], tmps2Data[3]; REAL8Vector tmps1Vec, tmps2Vec;
177  memcpy( tmps1Data, values+6, 3*sizeof(REAL8) );
178  memcpy( tmps2Data, values+9, 3*sizeof(REAL8) );
179  tmps1Vec.data = tmps1Data; tmps2Vec.data = tmps2Data;
180  tmps1Vec.length = tmps2Vec.length = 3;
181 
182  REAL8Vector *tmpsigmaKerr = NULL;
183  if ( !(tmpsigmaKerr = XLALCreateREAL8Vector( 3 )) )
184  {
186  }
187 
188  if ( XLALSimIMRSpinEOBCalculateSigmaKerr( tmpsigmaKerr, mass1, mass2,
189  &tmps1Vec, &tmps2Vec ) == XLAL_FAILURE )
190  {
191  XLALDestroyREAL8Vector( tmpsigmaKerr );
193  }
194 
195  /* Update a with the Kerr background spin
196  * Pre-compute the Hamiltonian coefficients */
197  REAL8Vector *delsigmaKerr = params.params->sigmaKerr;
198  params.params->sigmaKerr = tmpsigmaKerr;
199  params.params->a = sqrt( tmpsigmaKerr->data[0]*tmpsigmaKerr->data[0]
200  + tmpsigmaKerr->data[1]*tmpsigmaKerr->data[1]
201  + tmpsigmaKerr->data[2]*tmpsigmaKerr->data[2] );
202  //tmpsigmaKerr->data[2];
203  if ( XLALSimIMRCalculateSpinEOBHCoeffs( params.params->seobCoeffs, eta,
204  params.params->a, SpinAlignedEOBversion ) == XLAL_FAILURE )
205  {
206  XLALDestroyREAL8Vector( params.params->sigmaKerr );
208  }
209 
210  /* Release the old memory */
211  XLALDestroyREAL8Vector( delsigmaKerr );
212  }
213 
214  /* Now calculate derivatives w.r.t. each parameter */
215  for ( i = 0; i < 12; i++ )
216  {
217  params.varyParam = i;
218  if ( i >=6 && i < 9 )
219  {
220  XLAL_CALLGSL( gslStatus = gsl_deriv_central( &F, values[i],
221  STEP_SIZE*mass1*mass1, &tmpDValues[i], &absErr ) );
222  }
223  else if ( i >= 9 )
224  {
225  XLAL_CALLGSL( gslStatus = gsl_deriv_central( &F, values[i],
226  STEP_SIZE*mass2*mass2, &tmpDValues[i], &absErr ) );
227  }
228  else
229  {
230  XLAL_CALLGSL( gslStatus = gsl_deriv_central( &F, values[i],
231  STEP_SIZE, &tmpDValues[i], &absErr ) );
232  }
233  if ( gslStatus != GSL_SUCCESS )
234  {
235  XLALPrintError( "XLAL Error %s - Failure in GSL function\n", __func__ );
237  }
238  }
239 
240  /* Calculate the orbital angular momentum */
241  Lx = values[1]*values[5] - values[2]*values[4];
242  Ly = values[2]*values[3] - values[0]*values[5];
243  Lz = values[0]*values[4] - values[1]*values[3];
244 
245  magL = sqrt( Lx*Lx + Ly*Ly + Lz*Lz );
246 
247  Lhatx = Lx/magL;
248  Lhaty = Ly/magL;
249  Lhatz = Lz/magL;
250 
251  /* Calculate the polar data */
252  polarDynamics.length = 4;
253  polarDynamics.data = polData;
254 
255  r = polData[0] = sqrt( values[0]*values[0] + values[1]*values[1] + values[2]*values[2] );
256  polData[1] = 0;
257  polData[2] = values[0]*values[3] + values[1]*values[4] + values[2]*values[5];
258  polData[3] = magL / polData[0];
259 
260  /* We need to re-calculate the parameters at each step as spins may not be constant */
261  /* TODO: Modify so that only spin terms get re-calculated */
262 
263  /* We cannot point to the values vector directly as it leads to a warning */
264  s1.length = s2.length = s1norm.length = s2norm.length = 3;
265  s1.data = s1Data;
266  s2.data = s2Data;
267  s1norm.data = s1DataNorm;
268  s2norm.data = s2DataNorm;
269 
270  memcpy( s1Data, values+6, 3*sizeof(REAL8) );
271  memcpy( s2Data, values+9, 3*sizeof(REAL8) );
272  memcpy( s1DataNorm, values+6, 3*sizeof(REAL8) );
273  memcpy( s2DataNorm, values+9, 3*sizeof(REAL8) );
274 
275  for ( i = 0; i < 3; i++ )
276  {
277  s1DataNorm[i] /= (mass1+mass2)*(mass1+mass2);
278  s2DataNorm[i] /= (mass1+mass2)*(mass1+mass2);
279  }
280  //magS1 = sqrt(s1.data[0]*s1.data[0] + s1.data[1]*s1.data[1] + s1.data[2]*s1.data[2]);
281  //magS2 = sqrt(s2.data[0]*s2.data[0] + s2.data[1]*s2.data[1] + s2.data[2]*s2.data[2]);
282 
283  //chiS = 0.5 * ( magS1 / (mass1*mass1) + magS2 / (mass2*mass2) );
284  //chiA = 0.5 * ( magS1 / (mass1*mass1) - magS2 / (mass2*mass2) );
285 
286  sKerr.length = 3;
287  sKerr.data = sKerrData;
288  XLALSimIMRSpinEOBCalculateSigmaKerr( &sKerr, mass1, mass2, &s1, &s2 );
289 
290  sStar.length = 3;
291  sStar.data = sStarData;
292  XLALSimIMRSpinEOBCalculateSigmaStar( &sStar, mass1, mass2, &s1, &s2 );
293 
294  //a = sqrt(sKerr.data[0]*sKerr.data[0] + sKerr.data[1]*sKerr.data[1] + sKerr.data[2]*sKerr.data[2]);
295 
296  //XLALSimIMREOBCalcSpinFacWaveformCoefficients( params.params->eobParams->hCoeffs, mass1, mass2, eta, a, chiS, chiA );
297  //XLALSimIMRCalculateSpinEOBHCoeffs( params.params->seobCoeffs, eta, a );
298 
299  rVec.length = pVec.length = 3;
300  rVec.data = rData;
301  pVec.data = pData;
302 
303  memcpy( rData, values, sizeof(rData) );
304  memcpy( pData, values+3, sizeof(pData) );
305 
306  H = XLALSimIMRSpinEOBHamiltonian( eta, &rVec, &pVec, &s1norm, &s2norm,
307  &sKerr, &sStar, params.params->tortoise, params.params->seobCoeffs );
308 
309 
310  /* Now make the conversion */
311  /* rDot */
312  dvalues[0] = tmpDValues[3];
313  dvalues[1] = tmpDValues[4];
314  dvalues[2] = tmpDValues[5];
315 
316  /* Now calculate omega, and hence the flux */
317  rCrossV_x = values[1]*dvalues[2] - values[2]*dvalues[1];
318  rCrossV_y = values[2]*dvalues[0] - values[0]*dvalues[2];
319  rCrossV_z = values[0]*dvalues[1] - values[1]*dvalues[0];
320 
321  omega = sqrt( rCrossV_x*rCrossV_x + rCrossV_y*rCrossV_y + rCrossV_z*rCrossV_z ) / (r*r);
322  flux = XLALInspiralSpinFactorizedFlux( &polarDynamics, nqcCoeffs, omega, params.params, H/(mass1+mass2), lMax, SpinAlignedEOBversion );
323 
324  /* Looking at the non-spinning model, I think we need to divide the flux by eta */
325  flux = flux / eta;
326 
327  pDotS1 = pData[0]*s1Data[0] + pData[1]*s1Data[1] + pData[2]*s1Data[2];
328  pDotS2 = pData[0]*s2Data[0] + pData[1]*s2Data[1] + pData[2]*s2Data[2];
329  rrTerm2 = 8./15. *eta*eta * pow(omega,8./3.)/(magL*magL*r) * ((61.+48.*mass2/mass1)*pDotS1 + (61.+48.*mass1/mass2)*pDotS2);
330 
331  //printf( "rrForce = %e %e %e\n", - flux * values[3] / (omega*magL), - flux * values[4] / (omega*magL), - flux * values[5] / (omega*magL)) ;
332 
333  /* Now pDot */
334  dvalues[3] = - tmpDValues[0] - flux * values[3] / (omega*magL) + rrTerm2*Lx;
335  dvalues[4] = - tmpDValues[1] - flux * values[4] / (omega*magL) + rrTerm2*Ly;
336  dvalues[5] = - tmpDValues[2] - flux * values[5] / (omega*magL) + rrTerm2*Lz;
337 
338  /* spin1 */
339  //printf( "Raw spin1 derivatives = %e %e %e\n", tmpDValues[6], tmpDValues[7], tmpDValues[8] );
340  //printf( "Raw spin2 derivatives = %e %e %e\n", tmpDValues[9], tmpDValues[10], tmpDValues[11] );
341  dvalues[6] = mass1 * mass2 * (tmpDValues[7]*values[8] - tmpDValues[8]*values[7]);
342  dvalues[7] = mass1 * mass2 * (tmpDValues[8]*values[6] - tmpDValues[6]*values[8]);
343  dvalues[8] = mass1 * mass2 * (tmpDValues[6]*values[7] - tmpDValues[7]*values[6]);
344 
345  /* spin2 */
346  dvalues[9] = mass1 * mass2 * (tmpDValues[10]*values[11] - tmpDValues[11]*values[10]);
347  dvalues[10] = mass1 * mass2 * (tmpDValues[11]*values[9] - tmpDValues[9]*values[11]);
348  dvalues[11] = mass1 * mass2 * (tmpDValues[9]*values[10] - tmpDValues[10]*values[9]);
349 
350  /* phase and precessing bit */
351  dLx = dvalues[1]*values[5] - dvalues[2]*values[4]
352  + values[1]*dvalues[5] - values[2]*dvalues[4];
353 
354  dLy = dvalues[2]*values[3] - dvalues[0]*values[5]
355  + values[2]*dvalues[3] - values[0]*dvalues[5];
356 
357  dLz = dvalues[0]*values[4] - dvalues[1]*values[3]
358  + values[0]*dvalues[4] - values[1]*dvalues[3];
359 
360  dMagL = (Lx*dLx + Ly*dLy + Lz*dLz)/magL;
361 
362  dLhatx = (dLx*magL - Lx*dMagL)/(magL*magL);
363  dLhaty = (dLy*magL - Ly*dMagL)/(magL*magL);
364 
365  /* Finn Chernoff convention is used here. TODO: implement the geometric precessing convention */
366  if ( Lhatx == 0.0 && Lhaty == 0.0 )
367  {
368  alphadotcosi = 0.0;
369  }
370  else
371  {
372  alphadotcosi = Lhatz * (Lhatx*dLhaty - Lhaty*dLhatx) / (Lhatx*Lhatx + Lhaty*Lhaty);
373  }
374 
375  dvalues[12] = omega - alphadotcosi;
376  dvalues[13] = alphadotcosi;
377 
378  /*printf( " r = %e %e %e (mag = %e)\n", values[0], values[1], values[2], sqrt(values[0]*values[0] + values[1]*values[1] + values[2]*values[2]));
379  printf( " p = %e %e %e (mag = %e)\n", values[3], values[4], values[5], sqrt(values[3]*values[3] + values[4]*values[4] + values[5]*values[5]));
380  printf( "Derivatives:\n" );
381  for ( i = 0; i < 12; i++ )
382  {
383  printf( "\t%e", dvalues[i] );
384  }
385  printf( "\n" );
386  */
387  return XLAL_SUCCESS;
388 }
389 
390 
391 /**
392  * Calculate the derivative of the Hamiltonian w.r.t. a specific parameter
393  * Used by generic spin EOB model, including initial conditions solver.
394  */
396  const INT4 paramIdx, /**<< Index of the parameters */
397  const REAL8 values[], /**<< Dynamical variables */
398  SpinEOBParams *funcParams /**<< EOB Parameters */
399  )
400 {
401  static const REAL8 STEP_SIZE = 1.0e-3;
402 
404 
405  REAL8 result;
406 
407  gsl_function F;
408  INT4 gslStatus;
409 
410  REAL8 mass1, mass2;
411 
412  /* The error in a derivative as measured by GSL */
413  REAL8 absErr;
414 
415  /* Set up pointers for GSL */
416  params.values = values;
417  params.params = funcParams;
418 
419  F.function = &GSLSpinHamiltonianWrapper;
420  F.params = &params;
421  params.varyParam = paramIdx;
422 
423  mass1 = params.params->eobParams->m1;
424  mass2 = params.params->eobParams->m2;
425 
426  /* Now calculate derivatives w.r.t. the required parameter */
427  if ( paramIdx >=6 && paramIdx < 9 )
428  {
429  XLAL_CALLGSL( gslStatus = gsl_deriv_central( &F, values[paramIdx],
430  STEP_SIZE*mass1*mass1, &result, &absErr ) );
431  }
432  else if ( paramIdx >= 9 )
433  {
434  XLAL_CALLGSL( gslStatus = gsl_deriv_central( &F, values[paramIdx],
435  STEP_SIZE*mass2*mass2, &result, &absErr ) );
436  }
437  else
438  {
439  XLAL_CALLGSL( gslStatus = gsl_deriv_central( &F, values[paramIdx],
440  STEP_SIZE, &result, &absErr ) );
441  }
442  if ( gslStatus != GSL_SUCCESS )
443  {
444  XLALPrintError( "XLAL Error %s - Failure in GSL function\n", __func__ );
446  }
447 
448  //printf( "Abserr = %e\n", absErr );
449 
450  return result;
451 }
452 
453 
454 /**
455  * Wrapper for GSL to call the Hamiltonian function
456  */
457 static double GSLSpinHamiltonianWrapper( double x, void *params )
458 {
459  HcapDerivParams *dParams = (HcapDerivParams *)params;
460 
461  EOBParams *eobParams = dParams->params->eobParams;
462 
463  REAL8 tmpVec[12];
464  REAL8 s1normData[3], s2normData[3], sKerrData[3], sStarData[3];
465 
466  /* These are the vectors which will be used in the call to the Hamiltonian */
467  REAL8Vector r, p, spin1, spin2, spin1norm, spin2norm;
468  REAL8Vector sigmaKerr, sigmaStar;
469 
470  int i;
471  REAL8 a;
472  REAL8 m1 = eobParams->m1;
473  REAL8 m2 = eobParams->m2;
474  REAL8 mT2 = (m1+m2)*(m1+m2);
475 
476  /* Use a temporary vector to avoid corrupting the main function */
477  memcpy( tmpVec, dParams->values, sizeof(tmpVec) );
478 
479  /* Set the relevant entry in the vector to the correct value */
480  tmpVec[dParams->varyParam] = x;
481 
482  /* Set the LAL-style vectors to point to the appropriate things */
483  r.length = p.length = spin1.length = spin2.length = spin1norm.length = spin2norm.length = 3;
484  sigmaKerr.length = sigmaStar.length = 3;
485  r.data = tmpVec;
486  p.data = tmpVec+3;
487  spin1.data = tmpVec+6;
488  spin2.data = tmpVec+9;
489  spin1norm.data = s1normData;
490  spin2norm.data = s2normData;
491  sigmaKerr.data = sKerrData;
492  sigmaStar.data = sStarData;
493 
494  memcpy( s1normData, tmpVec+6, 3*sizeof(REAL8) );
495  memcpy( s2normData, tmpVec+9, 3*sizeof(REAL8) );
496 
497  for ( i = 0; i < 3; i++ )
498  {
499  s1normData[i] /= mT2;
500  s2normData[i] /= mT2;
501  }
502 
503  /* Calculate various spin parameters */
504  XLALSimIMRSpinEOBCalculateSigmaKerr( &sigmaKerr, eobParams->m1,
505  eobParams->m2, &spin1, &spin2 );
506  XLALSimIMRSpinEOBCalculateSigmaStar( &sigmaStar, eobParams->m1,
507  eobParams->m2, &spin1, &spin2 );
508  a = sqrt( sigmaKerr.data[0]*sigmaKerr.data[0] + sigmaKerr.data[1]*sigmaKerr.data[1]
509  + sigmaKerr.data[2]*sigmaKerr.data[2] );
510  //printf( "a = %e\n", a );
511  //printf( "aStar = %e\n", sqrt( sigmaStar.data[0]*sigmaStar.data[0] + sigmaStar.data[1]*sigmaStar.data[1] + sigmaStar.data[2]*sigmaStar.data[2]) );
512  if ( isnan( a ) )
513  {
514  printf( "a is nan!!\n");
515  }
516  //XLALSimIMRCalculateSpinEOBHCoeffs( dParams->params->seobCoeffs, eobParams->eta, a );
517  if (UsePrec)
518  {
519  /* Set up structures and calculate necessary PN parameters */
520  /* Due to precession, these need to get calculated in every step */
521  /* TODO: Only calculate non-spinning parts once */
522  memset( dParams->params->seobCoeffs, 0, sizeof(SpinEOBHCoeffs) );
523 
524  /* Update the Z component of the Kerr background spin
525  * Pre-compute the Hamiltonian coefficients */
526  REAL8Vector *delsigmaKerr = dParams->params->sigmaKerr;
527  dParams->params->sigmaKerr = &sigmaKerr;
528  dParams->params->a = a;
529  //tmpsigmaKerr->data[2];
531  eobParams->eta, a,
533  {
536  }
537 
538  /* Release the old memory */
539  XLALDestroyREAL8Vector( delsigmaKerr );
540  }
541 
542  //printf( "Hamiltonian = %e\n", XLALSimIMRSpinEOBHamiltonian( eobParams->eta, &r, &p, &sigmaKerr, &sigmaStar, dParams->params->seobCoeffs ) );
543  return XLALSimIMRSpinEOBHamiltonian( eobParams->eta, &r, &p, &spin1norm, &spin2norm, &sigmaKerr, &sigmaStar, dParams->params->tortoise, dParams->params->seobCoeffs ) / eobParams->eta;
544 }
545 
546 #endif /* _LALSIMIMRSPINEOBHCAPNUMERICALDERIVATIVE_C */
static int XLALSimIMRSpinEOBCalculateSigmaKerr(REAL8Vector *sigmaKerr, REAL8 mass1, REAL8 mass2, REAL8Vector *s1, REAL8Vector *s2)
Function to calculate normalized spin of the deformed-Kerr background in SEOBNRv1.
static int XLALSimIMRSpinEOBCalculateSigmaStar(REAL8Vector *sigmaStar, REAL8 mass1, REAL8 mass2, REAL8Vector *s1, REAL8Vector *s2)
Function to calculate normalized spin of the test particle in SEOBNRv1.
static REAL8 XLALInspiralSpinFactorizedFlux(REAL8Vector *values, EOBNonQCCoeffs *nqcCoeffs, const REAL8 omega, SpinEOBParams *ak, const REAL8 H, const UINT4 lMax, const UINT4 SpinAlignedEOBversion)
static UNUSED int UsePrec
static int XLALSimIMRCalculateSpinEOBHCoeffs(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 REAL8 XLALSimIMRSpinEOBHamiltonian(const REAL8 eta, REAL8Vector *restrict x, REAL8Vector *restrict p, REAL8Vector *restrict s1Vec, REAL8Vector *restrict s2Vec, REAL8Vector *restrict sigmaKerr, REAL8Vector *restrict sigmaStar, int tortoise, SpinEOBHCoeffs *coeffs)
static REAL8 XLALSpinHcapNumDerivWRTParam(const INT4 paramIdx, const REAL8 values[], SpinEOBParams *params)
Calculate the derivative of the Hamiltonian w.r.t.
static int XLALSpinHcapNumericalDerivative(double t, const REAL8 values[], REAL8 dvalues[], void *funcParams) UNUSED
static double GSLSpinHamiltonianWrapper(double x, void *params)
Wrapper for GSL to call the Hamiltonian function.
#define XLAL_CALLGSL(statement)
double i
Definition: bh_ringdown.c:118
const double H
double REAL8
uint32_t UINT4
int32_t INT4
static const INT4 r
static const INT4 a
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_ERROR_REAL8(...)
#define XLAL_ERROR(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFUNC
XLAL_FAILURE
list x
list p
The coefficients which are used in calculating the non-quasicircular correction to the EOBNRv2 model.
Structure containing all the parameters needed for the EOB waveform.
const REAL8 * values
SpinEOBParams * params
REAL8 * data
Parameters for the spinning EOB model, used in calculating the Hamiltonian.
UINT4 SpinAlignedEOBversion
Parameters for the spinning EOB model.
SpinEOBHCoeffs * seobCoeffs
EOBParams * eobParams
REAL8Vector * sigmaKerr
Definition: burst.c:245
LALDict * params
Definition: inspiral.c:248