Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALSTPNWaveform.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Drew Keppel, Gareth Jones, Craig Robinson , Thomas Cokelaer, Michele Vallisneri
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 * \author Vallisneri, M. Cokelaer, T.
22 * \file
23 * \ingroup LALInspiral_h
24 *
25 * \brief Module to generate STPN (spinning binaries) waveforms in agreement with
26 * the injecttion package (return a CoherentGW structure).
27 *
28 */
29
30
31#include <lal/Units.h>
32#include <lal/LALInspiral.h>
33#include <lal/SeqFactories.h>
34#include "LALSTPNWaveform2.h"
35
36/* private structure with PN parameters*/
37
38void LALSTPNderivatives(REAL8Vector *values, REAL8Vector *dvalues, void *mparams);
39typedef struct LALSTPNstructparams {
44 REAL8 wdotorb[9];
52 REAL8 epnorb[9]; /*added for stopping test */
54
55/* my function to set STPN derivatives*/
56
57
58
59
60
61void LALSTPNderivatives(REAL8Vector *values, REAL8Vector *dvalues, void *mparams) {
62
63 REAL8 omega;
64 REAL8 LNhx,LNhy,LNhz,LNhxy,LNmag;
65 REAL8 S1x,S1y,S1z;
66 REAL8 S2x,S2y,S2z;
67 REAL8 alphadotcosi;
68 REAL8 tmpx,tmpy,tmpz;
69 REAL8 dotLNS1,dotLNS2;
70 REAL8 crossx,crossy,crossz;
71 REAL8 ds,domega,domeganew;
72 REAL8 dLNhx,dLNhy,dLNhz;
73 REAL8 dS1x,dS1y,dS1z;
74 REAL8 dS2x,dS2y,dS2z;
75 REAL8 omega2;
76 REAL8 test; /*Michele-041208: added test, see below*/
77 REAL8 dotS1S2; /*Michele-041208: addede since it is used twice, see below*/
79
80 REAL8 v, v2, v3, v4, v7, v11;
81
82 /* --- computation start here --- */
83 omega = values->data[1];
84
85 LNhx = values->data[2];
86 LNhy = values->data[3];
87 LNhz = values->data[4];
88
89 S1x = values->data[5];
90 S1y = values->data[6];
91 S1z = values->data[7];
92
93 S2x = values->data[8];
94 S2y = values->data[9];
95 S2z = values->data[10];
96
97 /* domega: could be optimized by computing omega^(1/3) and then multiplying it*/
98 /* Thomas comments: in order to improve the speed I introduced the variable v and
99 * replace the previous* function by a new one taken into account that variable.
100 * the idea is to avoid most of the pow function which are quite slow*/
101
102
103 v = pow(omega, 1.0/3.0);
104 v2 = v * v;
105 v3 = v2 * v;
106 v4 = v3 * v; /* effectively used farther */
107 v7 = v4 * v3; /* effectively used farther */
108 v11 = v7 * v4; /* effectively used farther */
109
110 domeganew = params->wdotnew * v11;
111
112 if (omega < 0.0){
113 fprintf(stderr, "WARNING: Omega has become -ve, this should lead to nan's \n");
114 }
115
116 domega =
117 params->wdotorb[0]
118 + v * (params->wdotorb[1]
119 + v * ( params->wdotorb[2]
120 + v * ( params->wdotorb[3]
121 + v * ( params->wdotorb[4]
122 + v * ( params->wdotorb[5]
123 + v * ( params->wdotorb[6] + params->wdotorb[7] * log(omega)
124 + v * ( params->wdotorb[8] ) ) ) ) ) ) ) ;
125
126 /* Michele-041208: this evaluates the part of the test coming from the orbital energy */
127
128 test = -0.5 * params->eta * (
129 (2.0/3.0) * (1.0/v) * params->epnorb[0]
130 + params->epnorb[1]
131 + (4.0/3.0) * v * (params->epnorb[2]
132 + (5.0/4.0) * v * (params->epnorb[3]
133 + (6.0/5.0) * v * (params->epnorb[4]
134 + (7.0/6.0) * v * (params->epnorb[5]
135 + (8.0/7.0) * v * (params->epnorb[6]
136 + (9.0/8.0) * v * (params->epnorb[7]
137 + (10.0/9.0)* v * params->epnorb[8] )))))) );
138
139 domega += params->wspin15 * omega *
140 ( LNhx * (113.0 * S1x + 113.0 * S2x + 75.0 * params->m2m1 * S1x + 75.0 * params->m1m2 * S2x) +
141 LNhy * (113.0 * S1y + 113.0 * S2y + 75.0 * params->m2m1 * S1y + 75.0 * params->m1m2 * S2y) +
142 LNhz * (113.0 * S1z + 113.0 * S2z + 75.0 * params->m2m1 * S1z + 75.0 * params->m1m2 * S2z) );
143
144 dotLNS1 = (LNhx*S1x + LNhy*S1y + LNhz*S1z);
145 dotLNS2 = (LNhx*S2x + LNhy*S2y + LNhz*S2z);
146
147 /* Michele-041208: added dotS1S2 since it's used twice, also in test */
148 dotS1S2 = (S1x*S2x + S1y*S2y + S1z*S2z);
149
150 domega += params->wspin20 * v4 *
151 ( 247.0 * dotS1S2 -
152 721.0 * dotLNS1 * dotLNS2 );
153
154 domega *= domeganew;
155
156 /* Michele-041208: this evaluates the part of the test coming from the spin energy terms */
157 /* If more terms come in, they need to be added by hand */
158
159 if(params->wspin15 != 0.0)
160 test += -0.5 * params->eta *
161 (5.0/3.0) * v2 * ( (8.0/3.0 + 2.0*params->m2m1)*dotLNS1 + (8.0/3.0 + 2.0*params->m1m2)*dotLNS2 );
162 /* Michele-041208: here we multiply and divide by eta to keep parallelism
163 with the formula above; hopefully the compiler will simplify*/
164
165 if(params->wspin20 != 0.0)
166 test += -v3 * (dotS1S2 - 3.0 * dotLNS1 * dotLNS2);
167
168 /* dLN, 1.5PN*/
169
170 omega2 = omega * omega;
171
172 tmpx = (4.0 + 3.0*params->m2m1) * S1x + (4.0 + 3.0*params->m1m2) * S2x;
173 tmpy = (4.0 + 3.0*params->m2m1) * S1y + (4.0 + 3.0*params->m1m2) * S2y;
174 tmpz = (4.0 + 3.0*params->m2m1) * S1z + (4.0 + 3.0*params->m1m2) * S2z;
175
176 dLNhx = params->LNhdot15 * omega2 * (-tmpz*LNhy + tmpy*LNhz);
177 dLNhy = params->LNhdot15 * omega2 * (-tmpx*LNhz + tmpz*LNhx);
178 dLNhz = params->LNhdot15 * omega2 * (-tmpy*LNhx + tmpx*LNhy);
179
180 /* dLN, 2PN*/
181
182 tmpx = dotLNS2 * S1x + dotLNS1 * S2x;
183 tmpy = dotLNS2 * S1y + dotLNS1 * S2y;
184 tmpz = dotLNS2 * S1z + dotLNS1 * S2z;
185
186 dLNhx += params->LNhdot20 * v7 * (-tmpz*LNhy + tmpy*LNhz);
187 dLNhy += params->LNhdot20 * v7 * (-tmpx*LNhz + tmpz*LNhx);
188 dLNhz += params->LNhdot20 * v7 * (-tmpy*LNhx + tmpx*LNhy);
189
190 /* dS1, 1.5PN*/
191
192 LNmag = params->eta / v ;
193
194 crossx = (LNhy*S1z - LNhz*S1y);
195 crossy = (LNhz*S1x - LNhx*S1z);
196 crossz = (LNhx*S1y - LNhy*S1x);
197
198 dS1x = params->S1dot15 * omega2 * LNmag * crossx;
199 dS1y = params->S1dot15 * omega2 * LNmag * crossy;
200 dS1z = params->S1dot15 * omega2 * LNmag * crossz;
201
202 /* dS1, 2PN*/
203
204 tmpx = S1z*S2y - S1y*S2z;
205 tmpy = S1x*S2z - S1z*S2x;
206 tmpz = S1y*S2x - S1x*S2y;
207
208 dS1x += params->Sdot20 * omega2 *
209 (tmpx - 3.0 * dotLNS2 * crossx);
210 dS1y += params->Sdot20 * omega2 *
211 (tmpy - 3.0 * dotLNS2 * crossy);
212 dS1z += params->Sdot20 * omega2 *
213 (tmpz - 3.0 * dotLNS2 * crossz);
214
215 /* dS2, 1.5PN*/
216
217 crossx = (-LNhz*S2y + LNhy*S2z);
218 crossy = (-LNhx*S2z + LNhz*S2x);
219 crossz = (-LNhy*S2x + LNhx*S2y);
220
221 dS2x = params->S2dot15 * omega2 * LNmag * crossx;
222 dS2y = params->S2dot15 * omega2 * LNmag * crossy;
223 dS2z = params->S2dot15 * omega2 * LNmag * crossz;
224
225 /* dS2, 2PN*/
226
227 dS2x += params->Sdot20 * omega2 * (-tmpx - 3.0 * dotLNS1 * crossx);
228 dS2y += params->Sdot20 * omega2 * (-tmpy - 3.0 * dotLNS1 * crossy);
229 dS2z += params->Sdot20 * omega2 * (-tmpz - 3.0 * dotLNS1 * crossz);
230
231 /* -? the original equations had one additional spin term*/
232 /* Michele-041208: but I think it was an experimental term introduced by Yi and Alessandra */
233
234 /* dphi*/
235 LNhxy = LNhx*LNhx + LNhy*LNhy;
236 if(LNhxy > 0.0) alphadotcosi = LNhz * (LNhx*dLNhy - LNhy*dLNhx) / LNhxy;
237 else alphadotcosi = 0.0;
238
239 ds = omega - alphadotcosi;
240
241 /* copy back into dvalues structure*/
242
243 dvalues->data[0] = ds;
244 dvalues->data[1] = domega;
245
246 dvalues->data[2] = dLNhx;
247 dvalues->data[3] = dLNhy;
248 dvalues->data[4] = dLNhz;
249
250 dvalues->data[5] = dS1x;
251 dvalues->data[6] = dS1y;
252 dvalues->data[7] = dS1z;
253
254 dvalues->data[8] = dS2x;
255 dvalues->data[9] = dS2y;
256 dvalues->data[10]= dS2z;
257
258 dvalues->data[11] = 0;
259
260 /* Michele-041208: not a derivative, but pass it back here anyway */
261
262 values->data[11] = test;
263}
264
265
266
267
268
269
270
271void
274 REAL4Vector *signalvec,
276 )
277{
278
279 UINT4 count;
280 InspiralInit paramsInit;
283
284 ASSERT(signalvec, status,
285 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
286 ASSERT(signalvec->data, status,
287 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
289 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
290 ASSERT(params->nStartPad >= 0, status,
291 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
292 ASSERT(params->nEndPad >= 0, status,
293 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
294 ASSERT(params->fLower > 0, status,
295 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
296 ASSERT(params->tSampling > 0, status,
297 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
298 ASSERT(params->totalMass > 0., status,
299 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
300
301 LALInspiralSetup (status->statusPtr, &(paramsInit.ak), params);
303 LALInspiralChooseModel(status->statusPtr, &(paramsInit.func), &(paramsInit.ak), params);
305
306 memset(signalvec->data, 0, signalvec->length * sizeof( REAL4 ));
307 /* Call the engine function */
308 LALSTPNWaveformEngine(status->statusPtr, signalvec, NULL,NULL, NULL, NULL, NULL, &count, params, &paramsInit);
310
312 RETURN(status);
313}
314
315
316
317
318void
321 REAL4Vector *signalvec1,
322 REAL4Vector *signalvec2,
324 )
325{
326
327 UINT4 count;
328
329 InspiralInit paramsInit;
330
333
334 ASSERT(signalvec1, status,
335 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
336 ASSERT(signalvec1->data, status,
337 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
338 ASSERT(signalvec2, status,
339 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
340 ASSERT(signalvec2->data, status,
341 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
343 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
344 ASSERT(params->nStartPad >= 0, status,
345 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
346 ASSERT(params->nEndPad >= 0, status,
347 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
348 ASSERT(params->fLower > 0, status,
349 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
350 ASSERT(params->tSampling > 0, status,
351 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
352 ASSERT(params->totalMass > 0., status,
353 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
354
355 /*LALInspiralSetup (status->statusPtr, &(paramsInit.ak), params);
356 CHECKSTATUSPTR(status);
357 LALInspiralChooseModel(status->statusPtr, &(paramsInit.func), &(paramsInit.ak), params);
358 CHECKSTATUSPTR(status);
359 */
360 LALInspiralInit(status->statusPtr, params, &paramsInit);
361
362
363 memset(signalvec1->data, 0, signalvec1->length * sizeof( REAL4 ));
364 memset(signalvec2->data, 0, signalvec2->length * sizeof( REAL4 ));
365
366 /* Call the engine function */
367 LALSTPNWaveformEngine(status->statusPtr, signalvec1, signalvec2, NULL, NULL, NULL, NULL, &count, params, &paramsInit);
369
371 RETURN(status);
372}
373
374
375
376
377
378
379int newswitch = 0;
380
381void
384 CoherentGW *waveform,
386 PPNParamStruc *ppnParams
387 )
388{
389
390 UINT4 count, i;
391
392 REAL4Vector *a=NULL;/* pointers to generated amplitude data */
393 REAL4Vector *ff=NULL ;/* pointers to generated frequency data */
394 REAL8Vector *phi=NULL;/* pointer to generated phase data */
395 REAL4Vector *shift=NULL;/* pointer to generated phase data */
396
397 REAL8 phiC;/* phase at coalescence */
398 InspiralInit paramsInit;
399
401
404
405
406 /* Make sure parameter and waveform structures exist. */
407 ASSERT( params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
408 ASSERT(waveform, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
409 /* Make sure waveform fields don't exist. */
410 ASSERT( !( waveform->a ), status,
411 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
412 ASSERT( !( waveform->f ), status,
413 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
414 ASSERT( !( waveform->phi ), status,
415 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
416 ASSERT( !( waveform->shift ), status,
417 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
418
419 /* Compute some parameters*/
420 LALInspiralInit(status->statusPtr, params, &paramsInit);
422 if (paramsInit.nbins==0)
423 {
425 RETURN (status);
426 }
427
428 /* Now we can allocate memory and vector for coherentGW structure*/
429 LALSCreateVector(status->statusPtr, &ff, paramsInit.nbins);
431 LALSCreateVector(status->statusPtr, &a, 2*paramsInit.nbins);
433 LALDCreateVector(status->statusPtr, &phi, paramsInit.nbins);
435 LALSCreateVector(status->statusPtr, &shift, paramsInit.nbins);
437
438
439 /* By default the waveform is empty */
440 memset(ff->data, 0, paramsInit.nbins * sizeof(REAL4));
441 memset(a->data, 0, 2 * paramsInit.nbins * sizeof(REAL4));
442 memset(phi->data, 0, paramsInit.nbins * sizeof(REAL8));
443 memset(shift->data, 0, paramsInit.nbins * sizeof(REAL4));
444
445
446 /* Call the engine function */
447 if(newswitch==0) {
448 LALSTPNWaveformEngine(status->statusPtr, NULL, NULL, a, ff, phi, shift,&count, params, &paramsInit);
449 } else {
450 // void LALSTPNAdaptiveWaveformEngine(LALStatus *status,
451 // REAL4Vector *signalvec1,REAL4Vector *signalvec2,
452 // REAL4Vector *a,REAL4Vector *ff,REAL8Vector *phi,REAL4Vector *shift,
453 // UINT4 *countback,
454 // InspiralTemplate *params,InspiralInit *paramsInit);
455
456 //fprintf(stderr,"Using new engine.\n");
457 LALSTPNAdaptiveWaveformEngine(status->statusPtr, NULL, NULL, a, ff, phi, shift,&count, params, &paramsInit);
458 }
459
461 {
462 LALSDestroyVector(status->statusPtr, &ff);
464 LALSDestroyVector(status->statusPtr, &a);
466 LALDDestroyVector(status->statusPtr, &phi);
468 LALSDestroyVector(status->statusPtr, &shift);
470 }
471 ENDFAIL( status );
472
473 /* Check an empty waveform hasn't been returned */
474 for (i = 0; i < phi->length; i++)
475 {
476 if (phi->data[i] != 0.0) break;
477 if (i == phi->length - 1)
478 {
479 LALSDestroyVector(status->statusPtr, &ff);
481 LALSDestroyVector(status->statusPtr, &a);
483 LALDDestroyVector(status->statusPtr, &phi);
485 LALSDestroyVector(status->statusPtr, &shift);
487
489 RETURN( status );
490 }
491 }
492
493 {
494 phiC = phi->data[count-1] ;
495
496
497 for (i=0; i<count;i++)
498 {
499 phi->data[i] = -phiC + phi->data[i] +ppnParams->phi;
500 }
501
502 /* Allocate the waveform structures. */
503 if ( ( waveform->a = (REAL4TimeVectorSeries *)
504 LALMalloc( sizeof(REAL4TimeVectorSeries) ) ) == NULL ) {
506 LALINSPIRALH_MSGEMEM );
507 }
508 memset( waveform->a, 0, sizeof(REAL4TimeVectorSeries) );
509
510 if ( ( waveform->f = (REAL4TimeSeries *)
511 LALMalloc( sizeof(REAL4TimeSeries) ) ) == NULL ) {
512 LALFree( waveform->a ); waveform->a = NULL;
514 LALINSPIRALH_MSGEMEM );
515 }
516 memset( waveform->f, 0, sizeof(REAL4TimeSeries) );
517
518 if ( ( waveform->phi = (REAL8TimeSeries *)
519 LALMalloc( sizeof(REAL8TimeSeries) ) ) == NULL ) {
520 LALFree( waveform->a ); waveform->a = NULL;
521 LALFree( waveform->f ); waveform->f = NULL;
523 LALINSPIRALH_MSGEMEM );
524 }
525 memset( waveform->phi, 0, sizeof(REAL8TimeSeries) );
526
527 if ( ( waveform->shift = (REAL4TimeSeries *)
528 LALMalloc( sizeof(REAL4TimeSeries) ) ) == NULL ) {
529 LALFree( waveform->a ); waveform->a = NULL;
530 LALFree( waveform->f ); waveform->f = NULL;
531 LALFree( waveform->phi ); waveform->phi = NULL;
533 LALINSPIRALH_MSGEMEM );
534 }
535 memset( waveform->shift, 0, sizeof(REAL4TimeSeries) );
536
537
538
539 in.length = (UINT4)count;
540 in.vectorLength = 2;
542 &( waveform->a->data ), &in );
544 LALSCreateVector( status->statusPtr,
545 &( waveform->f->data ), count);
547 LALDCreateVector( status->statusPtr,
548 &( waveform->phi->data ), count );
550
551 LALSCreateVector( status->statusPtr,
552 &( waveform->shift->data ), count );
554
555
556
557
558 memcpy(waveform->f->data->data , ff->data, count*(sizeof(REAL4)));
559 memcpy(waveform->a->data->data , a->data, 2*count*(sizeof(REAL4)));
560 memcpy(waveform->phi->data->data ,phi->data, count*(sizeof(REAL8)));
561 memcpy(waveform->shift->data->data ,shift->data, count*(sizeof(REAL4)));
562
563 waveform->a->deltaT = waveform->f->deltaT = waveform->phi->deltaT = waveform->shift->deltaT
564 = 1./params->tSampling;
565
566 waveform->a->sampleUnits = lalStrainUnit;
567 waveform->f->sampleUnits = lalHertzUnit;
570
571 waveform->position = ppnParams->position;
572 waveform->psi = ppnParams->psi;
573
574
575 snprintf( waveform->a->name, LALNameLength, "STPN inspiral amplitudes" );
576 snprintf( waveform->f->name, LALNameLength, "STPN inspiral frequency" );
577 snprintf( waveform->phi->name, LALNameLength, "STPN inspiral phase" );
578 snprintf( waveform->shift->name, LALNameLength, "STPN inspiral polshift" );
579
580
581 /* --- fill some output ---*/
582 ppnParams->tc = (double)(count-1) / params->tSampling ;
583 ppnParams->length = count;
584 ppnParams->dfdt = ((REAL4)(waveform->f->data->data[count-1]
585 - waveform->f->data->data[count-2]))
586 * ppnParams->deltaT;
587 ppnParams->fStop = params->fFinal;
589 ppnParams->termDescription = GENERATEPPNINSPIRALH_MSGEFSTOP;
590
591 ppnParams->fStart = ppnParams->fStartIn;
592 } /* end phase condition*/
593
594 /* --- free memory --- */
595
596
597 LALSDestroyVector(status->statusPtr, &ff);
599 LALSDestroyVector(status->statusPtr, &a);
601 LALDDestroyVector(status->statusPtr, &phi);
603 LALSDestroyVector(status->statusPtr, &shift);
605
606
608 RETURN(status);
609}
610
611
612
613
614
615
616
617
618void
621 REAL4Vector *signalvec1,
622 REAL4Vector *signalvec2,
623 REAL4Vector *a,
624 REAL4Vector *ff,
625 REAL8Vector *phi,
626 REAL4Vector *shift,
627 UINT4 *countback,
629 InspiralInit *paramsInit
630 )
631
632{
633 /* declare model parameters*/
634
635 LALSTPNparams STPNparameters;
636 LALSTPNparams *mparams;
637
638 /* declare code parameters and variables*/
639 INT4 nn = 11+1; /* number of dynamical variables*/
640 /* Michele-041208: added one for "test" */
641 UINT4 count; /* integration steps performed*/
642 INT4 length; /* memory allocation structure*/
643 INT4 j; /* counter*/
644
645 rk4In in4; /* used to setup the Runge-Kutta integration*/
646 rk4GSLIntegrator *integrator;
647
648 expnCoeffs ak;
649
650
651 REAL8Vector dummy, values, dvalues, newvalues, yt, dym, dyt;
652
653 REAL8 lengths;
654 REAL4 v=0,h1,h2, amp=0;
655 REAL8 m;
656 REAL8 t; /* time (units of total mass)*/
657 REAL8 unitHz;
658 REAL8 dt;
659 REAL8 LNhztol = 1.0e-8;
660
661 /* declare initial values of dynamical variables*/
662 REAL8 initphi;
663 REAL8 initLNhx, initLNhy, initLNhz;
664 REAL8 initS1x, initS1y, initS1z;
665 REAL8 initS2x, initS2y, initS2z;
666
667 /* declare dynamical variables*/
668 REAL8 vphi, omega, LNhx, LNhy, LNhz, S1x, S1y, S1z, S2x, S2y, S2z;
669 REAL8 test=-2;
670 REAL8 alpha, alpha0, omegadot;
671 REAL8 f2a, apcommon;
672
675
676 /* set parameters from InspiralTemplate structure*/
677
678 /* I'm getting parameters from the "InspiralTemplate" structure: this is how it looks.
679 typedef struct tagInspiralTemplate
680 {
681 REAL8 alpha;
682 REAL8 alpha1;
683 REAL8 alpha2;
684 Approximant approximant;
685 REAL8 beta;
686 REAL8 chirpMass;
687 REAL8 distance; ... USE AS DISTANCE (meters)
688 REAL8 eccentricity;
689 REAL8 eta; ... SET TO symmetric mass ratio
690 REAL8 fCutoff;
691 REAL8 fendBCV;
692 REAL8 fFinal;
693 REAL8 fLower; ... USE AS INITIAL FREQUENCY (Hz)
694 INT4 ieta;
695 REAL8 inclination; ... NOT USED
696 INT4 level;
697 REAL4 minMatch;
698 REAL8 mass1; ... USE AS MASS1
699 REAL8 mass2; ... USE AS MASS2
700 InputMasses massChoice;
701 REAL8 mu; ... SET TO reduced mass
702 INT4 number;
703 INT4 nStartPad;
704 INT4 nEndPad;
705 REAL8 OmegaS;
706 REAL8 orbitTheta0; ... USE TO SET initLNh; CANNOT BE ZERO!
707 REAL8 orbitPhi0; ... USE TO SET initLNh
708 Order order; ... USE AS common PN order
709 REAL8 psi0;
710 REAL8 psi3;
711 REAL8 rFinal;
712 REAL8 rInitial;
713 REAL8 rLightRing;
714 REAL8 signalAmplitude; ... NOT USED
715 INT4Vector *segmentIdVec;
716 REAL8 spin1[3]; ... USE AS spin1 (not normalized) in units of mass1^2
717 REAL8 spin2[3]; ... USE AS spin2 (not normalized) in units of mass2^2
718 REAL8 sourceTheta; ... this is the position of the source (colatitude)
719 REAL8 sourcePhi; ... this is the position of the source (azimuth)
720 REAL8 startPhase; ... NOT USED
721 REAL8 startTime; ... NOT USED
722 REAL8 t0;
723 REAL8 t2;
724 REAL8 t3;
725 REAL8 t4;
726 REAL8 t5;
727 REAL8 tC;
728 REAL8 Theta;
729 REAL8 totalMass; ... SET TO mass1 + mass2
730 REAL8 tSampling; ... USE AS SAMPLING AND INTEGRATION TIME
731 REAL8 vFinal;
732 REAL8 vInitial;
733 REAL8 Zeta2;
734 struct tagInspiralTemplate *next;
735 struct tagInspiralTemplate *fine;
736 } InspiralTemplate; */
737
738
739 /* Michele-041208: in my code I used to compute some members of the
740 "params" structure (such as totalMass, eta) from more basic ones (such as mass1, mass2).
741 Am I to assume that all the parameter fields have already been set when "params" is passed?
742
743 Thomas 10/12/2004 : yes ny using LALInspiralParameterCalc function called in LALInspiralInit */
744
745
746 /* Make sure parameter and waveform structures exist. */
747 ASSERT(params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
748
749
750 /*===================*/
751
752 /* Compute some parameters*/
753
754 if (paramsInit->nbins==0)
755 {
757 RETURN (status);
758 }
759 ak = paramsInit->ak;
760
761
762 mparams = &STPNparameters;
763
764 /* -? I hope the units in the following are correct*/
765 /* MV-050829: they are correct if the distance is given in meters;
766 use (1e6 * LAL_PC_SI * params->distance) if distance is given
767 in Mpc; notice the minus here */
768
769 apcommon = -4.0 * params->mu * LAL_MRSUN_SI/(params->distance);
770
771 /* set units*/
772
773 m = params->totalMass * LAL_MTSUN_SI;
774 unitHz = params->totalMass * LAL_MTSUN_SI * (REAL8)LAL_PI;
775
776 /* -? dt is set from params; but Thomas' code also contained instructions to*/
777 /* set it as -1. * eta / ( params->tSampling * 5.0*LAL_MTSUN_SI*params->totalMass );*/
778
779 /* tSampling is in Hz, so dt is in seconds*/
780
781 dt = 1.0/params->tSampling;
782
783 /* -? if the integration timestep is too large, it could be set to a fraction of the total mass*/
784 /* dt = 10e-3 * m;*/
785
786 /* -- length in seconds from Newtonian formula; chirpm in seconds*/
787 lengths = (5.0/256.0) * pow(LAL_PI,-8.0/3.0)
788 * pow(params->chirpMass * LAL_MTSUN_SI * params->fLower,-5.0/3.0) / params->fLower;
789
790 length = ceil(log10(lengths/dt)/log10(2.0));
791 length = pow(2,length);
792 length *= 2;
793
794 /* set initial values of dynamical variables*/
795
796 initphi = 0.0; /* -? see code at the end; initial phase is disabled for the moment*/
797
798 /* note that Theta0 cannot be 0.0!*/
799 /*initLNhx = sin(params->orbitTheta0)*cos(params->orbitPhi0);
800 initLNhy = sin(params->orbitTheta0)*sin(params->orbitPhi0);
801 initLNhz = cos(params->orbitTheta0);*/
802
803 initLNhx = sin(params->inclination);
804 initLNhy = 0.;
805 initLNhz = cos(params->inclination);
806
807 initS1x = params->spin1[0] * (params->mass1 * params->mass1) / (params->totalMass * params->totalMass);
808 initS1y = params->spin1[1] * (params->mass1 * params->mass1) / (params->totalMass * params->totalMass);
809 initS1z = params->spin1[2] * (params->mass1 * params->mass1) / (params->totalMass * params->totalMass);
810
811 initS2x = params->spin2[0] * (params->mass2 * params->mass2) / (params->totalMass * params->totalMass);
812 initS2y = params->spin2[1] * (params->mass2 * params->mass2) / (params->totalMass * params->totalMass);
813 initS2z = params->spin2[2] * (params->mass2 * params->mass2) / (params->totalMass * params->totalMass);
814
815
816 dummy.length = nn * 6;
817
818 values.length = dvalues.length = newvalues.length =
819 yt.length = dym.length = dyt.length = nn;
820
821 if (!(dummy.data = (REAL8 * ) LALMalloc(sizeof(REAL8) * nn * 6))) {
822 ABORT(status, LALINSPIRALH_EMEM, LALINSPIRALH_MSGEMEM);
823 }
824
825 values.data = &dummy.data[0];
826 dvalues.data = &dummy.data[nn];
827 newvalues.data = &dummy.data[2*nn];
828 yt.data = &dummy.data[3*nn];
829 dym.data = &dummy.data[4*nn];
830 dyt.data = &dummy.data[5*nn];
831
832 /* setup coefficients for PN equations*/
833
834 mparams->m2m1 = params->mass2 / params->mass1;
835 mparams->m1m2 = params->mass1 / params->mass2;
836 /* params->eta might have been set up before but just for safety, we
837 * recompute it here below.*/
838 params->eta = (params->mass1 * params->mass2)/
839 (params->mass1 + params->mass2)/(params->mass1 + params->mass2);
840 mparams->eta = params->eta;
841 mparams->wdotnew = (96.0/5.0) * params->eta;
842
843 /* Michele-041208: I trust (but did not check), that the same numbering
844 that I used for the wdotorb[] coefficients is shared by the ak
845 terms, especially given that wdotorb[6] and wdotorb[7] are both
846 3PN terms for me
847
848 Thomas-10Dec04 Indeed wdotorb[6] and [7] are part of 3PN and I took that
849 into account in the LALInspiralSetup function. */
850
851 /* Michele-041208: added epnorb initialization; is newtonian = 0? */
852
853 for (j = LAL_PNORDER_NEWTONIAN; j <= 8; j++) {
854 mparams->wdotorb[j] = ak.ST[j];
855 mparams->epnorb[j] = 0.0;
856 }
857
858 mparams->epnorb[0] = 1.0;
859
860 /* Michele-041208: modified for epnorb initialization; perhaps the logic is not the best */
861
862
863 switch (params->order){
865 case LAL_PNORDER_HALF:
866 case LAL_PNORDER_ONE:
867 for (j = params->order + 1; j <= 8; j++){
868 mparams->wdotorb[j] = 0;
869 }
870 mparams->wspin15 = 0.0;
871 mparams->LNhdot15 = 0.0;
872 mparams->S1dot15 = 0.0;
873 mparams->S2dot15 = 0.0;
874 mparams->wspin20 = 0.0;
875 mparams->LNhdot20 = 0.0;
876 mparams->Sdot20 = 0.0;
877 mparams->epnorb[2] = -(1.0/12.0) * (9.0 + params->eta); /* 1PN*/
878
879 break;
881 for (j = params->order + 1; j <= 8; j++){
882 mparams->wdotorb[j] = 0;
883 }
884 mparams->wspin15 = -(1.0/12.0);
885 mparams->LNhdot15 = 0.5;
886 mparams->S1dot15 = (4.0 + 3.0 * mparams->m2m1) / 2.0 ;
887 mparams->S2dot15 = (4.0 + 3.0 * mparams->m1m2) / 2.0 ;
888 mparams->wspin20 = 0.0;
889 mparams->LNhdot20 = 0.0;
890 mparams->Sdot20 = 0.0;
891 mparams->epnorb[2] = -(1.0/12.0) * (9.0 + params->eta); /* 1PN*/
892
893 break;
894 case LAL_PNORDER_TWO:
898 for (j = params->order +1; j <= 8; j++){
899 mparams->wdotorb[j] = 0;
900 }
901 mparams->wspin15 = -(1.0/12.0);
902 mparams->wspin20 = -(1.0/48.0) / params->eta ;
903 mparams->LNhdot20 = -1.5 / params->eta;
904 mparams->Sdot20 = 0.5;
905 mparams->LNhdot15 = 0.5;
906 mparams->S1dot15 = (4.0 + 3.0 * mparams->m2m1) / 2.0 ;
907 mparams->S2dot15 = (4.0 + 3.0 * mparams->m1m2) / 2.0 ;
908 mparams->epnorb[2] = -(1.0/12.0) * (9.0 + params->eta); /* 1PN*/
909 mparams->epnorb[4] = (1.0/24.0) * (-81.0 + 57.0*params->eta - params->eta*params->eta); /* 2PN*/
911 mparams->epnorb[6] = ( -(675.0/64.0) /* 3PN*/
912 +( (209323.0/4032.0) -(205.0/96.0)*LAL_PI*LAL_PI
913 -(110.0/9.0) * (-1987.0/3080.0) ) * params->eta
914 -(155.0/96.0)*params->eta*params->eta - (35.0/5184.0)*params->eta*params->eta*params->eta );
915 break;
916 default:
917 ABORT( status, LALINSPIRALH_EORDERMISSING, LALINSPIRALH_MSGEORDERMISSING );
918 }
919
920 if (params->order == LAL_PNORDER_THREE)
921 mparams->wdotorb[(int)(LAL_PNORDER_THREE+1)] = ak.ST[(int)(LAL_PNORDER_THREE+1)];
923 mparams->wdotorb[8] = ak.ST[8];
924
925
926
927 /* setup initial conditions for dynamical variables*/
928
929 vphi = initphi;
930 omega = params->fLower * unitHz;
931
932 LNhx = initLNhx;
933 LNhy = initLNhy;
934 LNhz = initLNhz;
935
936 S1x = initS1x;
937 S1y = initS1y;
938 S1z = initS1z;
939
940 S2x = initS2x;
941 S2y = initS2y;
942 S2z = initS2z;
943
944 alpha0 = atan2(LNhy,LNhx);
945
946 /* copy everything in the "values" structure*/
947
948 values.data[0] = vphi;
949 values.data[1] = omega;
950
951 values.data[2] = LNhx;
952 values.data[3] = LNhy;
953 values.data[4] = LNhz;
954
955 values.data[5] = S1x;
956 values.data[6] = S1y;
957 values.data[7] = S1z;
958
959 values.data[8] = S2x;
960 values.data[9] = S2y;
961 values.data[10]= S2z;
962
963 /* setup LALRungeKutta4: parameters are
964 - "newvalues" (some kind of array allocated above with "dummy")
965 - "in4":
966 TestFunction *function -> is set to the derivative function
967 REAL8 x (time) -> is set to the time over m
968 REAL8Vector *y -> is a pointer set to "&values": current variables
969 REAL8Vector *dydx -> is a pointer set to "&dvalues": current derivatives
970 REAL8Vector *yt -> is a pointer set to "&yt"; probably a workbuffer
971 REAL8Vector *dym -> is a pointer set to "&dym"; probably a workbuffer
972 REAL8Vector *dyt -> is a pointer set to "&dyt"; probably a workbuffer
973 REAL8 h -> is the timestep, set to dt/m
974 INT4 n
975 - "funcParams": void pointer to some parameters needed by derivatives */
976
978 in4.y = &values;
979 in4.dydx = &dvalues;
980 in4.h = dt/m;
981 in4.n = nn;
982 in4.yt = &yt;
983 in4.dym = &dym;
984 in4.dyt = &dyt;
985
986 xlalErrno = 0;
987 /* Initialize GSL integrator */
988 if (!(integrator = XLALRungeKutta4Init(nn, &in4)))
989 {
990 INT4 errNum = XLALClearErrno();
991 LALFree(dummy.data);
992
993 if (errNum == XLAL_ENOMEM)
994 ABORT(status, LALINSPIRALH_EMEM, LALINSPIRALH_MSGEMEM);
995 else
996 ABORTXLAL( status );
997 }
998
999 /* main integration loop*/
1000
1001 /*---- Uncomment the next 2 lines for debugging ----*/
1002 /*FILE *outFile=NULL;
1003 outFile = fopen("STPN-dynamics.dat", "w");*/
1004 /*--------------------------------------------------*/
1005
1006 t = 0.0;
1007 count = 0;
1008
1009 /* -- for the first step let's assume omegadot is positive;*/
1010 /* otherwise I should call the derivative function here*/
1011
1012 LALSTPNderivatives(&values,&dvalues,(void*)mparams);
1013 omegadot = dvalues.data[1];
1014
1015 /* -? the original BCV target model had one additional stopping test*/
1016 /* that I should probably reinstate*/
1017 /* Michele-041208: you do a do-while loop, while I had a while; we're trusting that the first
1018 step does not exit already, which is probably acceptable */
1019
1020 /* Thomas-10Dev04: I do not remember why I did .... but not for nothing for sure.
1021 It might be an empty bin at beginning or a shift im time of one bin in the coherent
1022 code...*/
1023
1024 if (a || signalvec2)
1025 params->nStartPad = 0; /* must be zero for templates and injection */
1026
1027 do {
1028
1029 /* fprintf(stderr,"%d %d %15.12lf %15.12lf %15.12lf %15.12lf %15.12lf\n", count, length, omegadot, LNhz*LNhz, LNhztol, omega, unitHz);*/
1030 if ((signalvec1 && count >= signalvec1->length) || (ff && count >= ff->length))
1031 {
1032 XLALRungeKutta4Free( integrator );
1033 LALFree(dummy.data);
1034 ABORT(status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
1035 }
1036
1037 /* From SimulateCoherentGW.h:
1038 <<We therefore write the waveforms in terms of two polarization amplitudes $A_1(t)$
1039 and $A_2(t)$, a single phase function $\phi(t)$, and a polarization shift $\Phi(t)$:
1040 h_+(t) = A_1(t)\cos\Phi(t)\cos\phi(t) - A_2(t)\sin\Phi(t)\sin\phi(t)
1041 h_\times(t) = A_1(t)\sin\Phi(t)\cos\phi(t) + A_2(t)\cos\Phi(t)\sin\phi(t)>>
1042
1043 Note: I can only do it if BCV2's Theta = 0. Hopefully that degree of freedom can
1044 be recovered from the orientation of the initial angular momentum. */
1045
1046 /* now setting the wave from the dynamical variables*/
1047
1048 if(LNhx*LNhx + LNhy*LNhy > 0.0) {
1049 alpha = atan2(LNhy,LNhx); alpha0 = alpha;
1050 } else {
1051 alpha = alpha0;
1052 }
1053
1054 /* I don't really need i, because I can use the explicit formulae below*/
1055 /* i = acos(LNhz);*/
1056
1057 /* -? if omega is in units of total masses, then the following conversion is correct*/
1058 /* was previously f2a = pow (f2aFac * omega, 2./3.)*/
1059 f2a = pow(omega, 2./3.);
1060
1061 /* the ff assignment is fine, since unitHz is pi M Msun [s]*/
1062 /* a->data[2*count] = (REAL4)(apcommon * f2a * (-0.25) * (3.0 + cos(2*i)));*/
1063 /* a->data[2*count+1] = (REAL4)(apcommon * f2a * (-cos(i))); */
1064
1065 if (signalvec1)
1066 {
1067 v = pow(omega, (1./3.));
1068 amp = params->signalAmplitude*v*v;
1069
1070
1071 h1 = -0.5 * amp * cos(2.*vphi) * cos(2.*alpha) * (1. + LNhz*LNhz) + amp * sin(2.*vphi) * sin(2.*alpha) * LNhz;
1072 *(signalvec1->data + count) = (REAL4) h1;
1073
1074 if (signalvec2)
1075 {
1076 h2 = -0.5 * amp * cos(2.*vphi) * sin(2.*alpha) * (1. + LNhz*LNhz) - amp * sin(2.*vphi) * cos(2.*alpha) * LNhz;
1077 *(signalvec2->data + count) = (REAL4) h2;
1078 }
1079
1080 }
1081 else if (a)
1082 {
1083 /* MV-050829: note that the two amplitudes here differ by a
1084 minus w.r.t. the definitions commented above. But these are the correct ones. */
1085
1086 ff->data[count]= (REAL4)(omega/unitHz);
1087 a->data[2*count] = (REAL4)(apcommon * f2a * 0.5 * (1 + LNhz*LNhz));
1088 a->data[2*count+1] = (REAL4)(apcommon * f2a * LNhz);
1089 phi->data[count] = (REAL8)(2.0 * vphi);
1090 shift->data[count] = (REAL4)(2.0 * alpha);
1091 }
1092
1093 /*---- Uncomment the next line for debugging ----*/
1094 /*fprintf(outFile,"%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
1095 t, vphi, omega, 2.0*alpha, LNhx, LNhy, LNhz,
1096 S1x, S1y, S1z, S2x, S2y, S2z);*/
1097 /* ----------------------------------------------*/
1098
1099 /* Debugging: it can be occasionally useful to store dynamical variables
1100 in the waveform output structure. Keep this here.
1101
1102 ff->data[count] = omega; phi->data[count] = vphi;
1103 a->data[2*count] = LNhx; a->data[2*count+1] = LNhy; shift->data[count] = LNhz; */
1104
1105 /* advancing time and calling stepper; time is in units of total mass*/
1106
1107 in4.x = t/m;
1108
1109 /* This integrator should be replaced, eventually,*/
1110 /* by a variable-timestep algorithm*/
1111
1112 LALRungeKutta4(status->statusPtr, &newvalues, integrator, (void*)mparams);
1114
1115 /* updating values of dynamical variables*/
1116
1117 vphi = values.data[0] = newvalues.data[0];
1118 omega = values.data[1] = newvalues.data[1];
1119
1120 LNhx = values.data[2] = newvalues.data[2];
1121 LNhy = values.data[3] = newvalues.data[3];
1122 LNhz = values.data[4] = newvalues.data[4];
1123
1124 S1x = values.data[5] = newvalues.data[5];
1125 S1y = values.data[6] = newvalues.data[6];
1126 S1z = values.data[7] = newvalues.data[7];
1127
1128 S2x = values.data[8] = newvalues.data[8];
1129 S2y = values.data[9] = newvalues.data[9];
1130 S2z = values.data[10]= newvalues.data[10];
1131
1132 LALSTPNderivatives(&values,&dvalues,(void*)mparams);
1133 omegadot = dvalues.data[1];
1134
1135 test = values.data[11];
1136
1137 t = (++count - params->nStartPad) * dt;
1138
1139 }
1140 /* Test that omega/unitHz < NYQUIST */
1141 while(test < 0.0 && omegadot > 0 && omega/unitHz < params->tSampling/2. && !(isnan(omega))) ;
1142
1143 /* if code stopped since evolving quantities became nan write an error message */
1144 if (isnan(omega)){
1145 fprintf(stderr,
1146 "WARNING: evolving quantities have become nan. "
1147 "m1: %e, "
1148 "m2: %e, "
1149 "spin1x: %e, "
1150 "spin1y: %e, "
1151 "spin1z: %e, "
1152 "spin2x: %e, "
1153 "spin2y: %e, "
1154 "spin2z: %e, "
1155 "inclination: %e\n ",
1156 params->mass1, params->mass2,
1157 params->spin1[0], params->spin1[1], params->spin1[2],
1158 params->spin2[0], params->spin2[1], params->spin2[2],
1160 }
1161 /* if code stopped due to co-ord singularity write an error message */
1162 else if (!(LNhz*LNhz < 1.0 - LNhztol)){
1163 fprintf( stderr,
1164 "WARNING: Injection terminated, co-ord singularity. "
1165 "m1: %e, "
1166 "m2: %e, "
1167 "spin1x: %e, "
1168 "spin1y: %e, "
1169 "spin1z: %e, "
1170 "spin2x: %e, "
1171 "spin2y: %e, "
1172 "spin2z: %e, "
1173 "inclination: %e\n ",
1174 params->mass1, params->mass2,
1175 params->spin1[0], params->spin1[1], params->spin1[2],
1176 params->spin2[0], params->spin2[1], params->spin2[2],
1178 }
1179
1180 /* Michele-041208: modified, added test */
1181 /* Michele-041208: to check, is omega really in Hz? */
1182 /* Michele-041208: the original Mathematica code, stopped the
1183 inspiral at the ISCO for order = newtonian. This is not currently implemented here. */
1184
1185 /*---- Uncomment next line for debugging ----*/
1186 /*fclose(outFile);*/
1187 /*-------------------------------------------*/
1188
1189
1190 /* -? the EOB version saves some final values in params; I'm doing only fFinal*/
1191
1192 if (signalvec1 || signalvec2){
1193 params->fFinal = pow(v,3.)/(LAL_PI*m);
1194 }
1195 else if (a){
1196 params->fFinal =ff->data[count-1];
1197 }
1198
1199 /* -? this looks like the final phase is being subtracted from the phase history*/
1200 /* this operations negates the use of initphi, which is set to 0.0 anyway*/
1201 /* -? I will comment this out to compare with my Mathematica code*/
1202
1203 if (signalvec1 && !signalvec2) params->tC = t;
1204 *countback = count;
1205
1206
1207 XLALRungeKutta4Free( integrator );
1208 LALFree(dummy.data);
1209
1211 RETURN(status);
1212}
static INT4 test(REAL4, REAL4, REAL4, REAL4, REAL4, REAL4, REAL4, REAL4)
void XLALRungeKutta4Free(rk4GSLIntegrator *integrator)
void LALInspiralSetup(LALStatus *status, expnCoeffs *ak, InspiralTemplate *params)
void LALInspiralInit(LALStatus *status, InspiralTemplate *params, InspiralInit *paramsInit)
void LALInspiralChooseModel(LALStatus *status, expnFunc *func, expnCoeffs *ak, InspiralTemplate *params)
void LALRungeKutta4(LALStatus *, REAL8Vector *, rk4GSLIntegrator *, void *)
rk4GSLIntegrator * XLALRungeKutta4Init(INT4 n, rk4In *input)
#define LALMalloc(n)
#define LALFree(p)
void LALSTPNAdaptiveWaveformEngine(LALStatus *status, REAL4Vector *signalvec1, REAL4Vector *signalvec2, REAL4Vector *a, REAL4Vector *ff, REAL8Vector *phi, REAL4Vector *shift, UINT4 *countback, InspiralTemplate *params, InspiralInit *paramsInit)
void LALSTPNWaveform(LALStatus *status, REAL4Vector *signalvec, InspiralTemplate *params)
int newswitch
void LALSTPNWaveformEngine(LALStatus *status, REAL4Vector *signalvec1, REAL4Vector *signalvec2, REAL4Vector *a, REAL4Vector *ff, REAL8Vector *phi, REAL4Vector *shift, UINT4 *countback, InspiralTemplate *params, InspiralInit *paramsInit)
void LALSTPNderivatives(REAL8Vector *values, REAL8Vector *dvalues, void *mparams)
void LALSTPNWaveformTemplates(LALStatus *status, REAL4Vector *signalvec1, REAL4Vector *signalvec2, InspiralTemplate *params)
void LALSTPNWaveformForInjection(LALStatus *status, CoherentGW *waveform, InspiralTemplate *params, PPNParamStruc *ppnParams)
#define ABORT(statusptr, code, mesg)
#define CHECKSTATUSPTR(statusptr)
#define ENDFAIL(statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
#define ABORTXLAL(sp)
#define BEGINFAIL(statusptr)
#define fprintf
double i
void LALSCreateVectorSequence(LALStatus *status, REAL4VectorSequence **vectorSequence, CreateVectorSequenceIn *vSeqParams)
#define GENERATEPPNINSPIRALH_EFSTOP
Reached requested termination frequency.
#define LAL_PI
#define LAL_MTSUN_SI
#define LAL_MRSUN_SI
double REAL8
uint32_t UINT4
int32_t INT4
float REAL4
LALNameLength
#define LALINSPIRALH_EORDERMISSING
The PN order requested is not implemented for this approximant.
Definition: LALInspiral.h:73
#define LALINSPIRALH_EMEM
Memory allocation error.
Definition: LALInspiral.h:57
#define LALINSPIRALH_ENULL
Arguments contained an unexpected null pointer.
Definition: LALInspiral.h:56
#define LALINSPIRALH_ESIZE
Invalid input range.
Definition: LALInspiral.h:59
LAL_PNORDER_TWO_POINT_FIVE
LAL_PNORDER_THREE
LAL_PNORDER_TWO
LAL_PNORDER_ONE
LAL_PNORDER_THREE_POINT_FIVE
LAL_PNORDER_HALF
LAL_PNORDER_ONE_POINT_FIVE
LAL_PNORDER_NEWTONIAN
static const INT4 m
static const INT4 a
const LALUnit lalStrainUnit
const LALUnit lalHertzUnit
const LALUnit lalDimensionlessUnit
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALSCreateVector(LALStatus *, REAL4Vector **, UINT4)
#define xlalErrno
int XLALClearErrno(void)
XLAL_ENOMEM
double alpha
REAL4TimeSeries * shift
SkyPosition position
REAL4TimeVectorSeries * a
REAL8TimeSeries * phi
REAL4TimeSeries * f
expnFunc func
Definition: LALInspiral.h:680
expnCoeffs ak
Definition: LALInspiral.h:679
The inspiral waveform parameter structure containing information about the waveform to be generated.
Definition: LALInspiral.h:205
REAL8 wdotorb[9]
This structure stores the parameters for constructing a restricted post-Newtonian waveform.
const CHAR * termDescription
The termination code description (above)
INT4 termCode
The termination condition (above) that stopped computation of the waveform.
REAL4 dfdt
The maximum value of encountered over any timestep used in generating the waveform.
REAL4 phi
The phase at coalescence (or arbitrary reference phase for a post -Newtonian approximation),...
REAL4 psi
polarization angle (radians)
REAL4 fStart
The actual starting frequency of the waveform, in Hz (normally close but not identical to fStartIn)
SkyPosition position
location of source on sky
UINT4 length
The length of the generated waveform.
REAL4 fStop
The frequency at the termination of the waveform, in Hz.
REAL8 tc
The time from the start of the waveform to coalescence (in the point-mass approximation),...
REAL4 fStartIn
The requested starting frequency of the waveform, in Hz.
REAL8 deltaT
The requested sampling interval of the waveform, in s.
CHAR name[LALNameLength]
REAL4Sequence * data
LALUnit sampleUnits
CHAR name[LALNameLength]
REAL4VectorSequence * data
REAL4 * data
REAL8Sequence * data
LALUnit sampleUnits
CHAR name[LALNameLength]
REAL8 * data
This structure contains various post-Newtonian and P-approximant expansion coefficients; the meanings...
Definition: LALInspiral.h:399
REAL8 ST[9]
Definition: LALInspiral.h:464
double inclination
double distance
Structure containing steps and controls for the GSL Runge-Kutta solver.
Definition: LALInspiral.h:637
Structure used as an input to Runge-Kutta solver.
Definition: LALInspiral.h:620
REAL8Vector * dym
Definition: LALInspiral.h:626
REAL8 x
Definition: LALInspiral.h:622
REAL8Vector * yt
Definition: LALInspiral.h:625
REAL8Vector * dydx
Definition: LALInspiral.h:624
REAL8 h
Definition: LALInspiral.h:628
REAL8Vector * dyt
Definition: LALInspiral.h:627
INT4 n
Definition: LALInspiral.h:629
REAL8Vector * y
Definition: LALInspiral.h:623
TestFunction * function
Definition: LALInspiral.h:621