Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralTaylorT4Waveform.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2008 B.S. Sathyaprakash, Bala R. Iyer
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 Sathyaprakash, B. S., Cokelaer T.
22 * \file
23 * \brief NONE
24 *
25 */
26/*-------------------------------------------------------------------*/
27#include <math.h>
28#include <lal/LALInspiral.h>
29#include <lal/SeqFactories.h>
30#include <lal/FindRoot.h>
31#include <lal/Units.h>
32
34 REAL8Vector *values,
35 REAL8Vector *dvalues,
36 void *funcParams
37);
38
40 REAL8Vector *values,
41 REAL8Vector *dvalues,
42 void *funcParams
43);
44
46 REAL8Vector *values,
47 REAL8Vector *dvalues,
48 void *funcParams
49);
50
52 REAL8Vector *values,
53 REAL8Vector *dvalues,
54 void *funcParams
55);
56
59 REAL4Vector *signalvec,
61);
62
65 REAL4Vector *signalvec1,
66 REAL4Vector *signalvec2,
68 REAL4Vector *ff,
69 REAL8Vector *phi,
70 UINT4 *countback,
72 InspiralInit *paramsInit
73);
74
76 REAL8Vector *values,
77 REAL8Vector *dvalues,
78 void *funcParams
79)
80{
82 REAL8 v, v2, v3, v4, v5, v6, v9, eta, eta2, fourpi;
83
84 ak = (InspiralDerivativesIn *) funcParams;
85 eta = ak->coeffs->eta;
86
87 v = values->data[0];
88 eta2 = eta * eta;
89 v2 = v*v;
90 v3 = v2*v;
91 v4 = v3*v;
92 v5 = v4*v;
93 v6 = v5*v;
94 v9 = v6*v3;
95 fourpi = 4.*LAL_PI;
96
97 /*--------------------------------------------------------------------*/
98 /* The Expression for dv/dt in the code is simplied after */
99 /* evaluating all the fractions so as to speed of the code */
100 /* The PN expansion from which it results is given by: dv/dt = */
101 /* (32*v^9*\[Eta]*(1 + 4*Pi*v^3 + v^2*(-743/336 - (11*\[Eta])/4) */
102 /* + v^5*((-4159*Pi)/672 - (189*Pi*\[Eta])/8) */
103 /* + v^4*(34103/18144 + (13661*\[Eta])/2016 + (59*\[Eta]^2)/18) */
104 /* + v^7*((-4415*Pi)/4032 + (358675*Pi*\[Eta])/6048 */
105 /* + (91495*Pi*\[Eta]^2)/1512) + v^6*(16447322263/139708800 */
106 /* - (1712*EulerGamma)/105 + (16*Pi^2)/3 - (56198689*\[Eta])/217728 */
107 /* + (451*Pi^2*\[Eta])/48 + (541*\[Eta]^2)/896 - (5605*\[Eta]^3)/2592 */
108 /* - (856*Log[16])/105 - (1712*Log[v])/105)))/5 */
109 /*--------------------------------------------------------------------*/
110
111 dvalues->data[0] = 6.4*v9*eta/ak->totalmass*(1.
112 + v2*(-2.2113095238095237 - 2.75*eta) + v3*fourpi
113 + v4*(1.8795745149911816 + 6.77628968*eta + 3.27777778*eta2));
114
115 dvalues->data[1] = v3/ak->totalmass;
116}
117
119 REAL8Vector *values,
120 REAL8Vector *dvalues,
121 void *funcParams
122)
123{
125 REAL8 v, v2, v3, v4, v5, v6, v9, eta, eta2, fourpi;
126
127 ak = (InspiralDerivativesIn *) funcParams;
128 eta = ak->coeffs->eta;
129
130 v = values->data[0];
131 eta2 = eta * eta;
132 v2 = v*v;
133 v3 = v2*v;
134 v4 = v3*v;
135 v5 = v4*v;
136 v6 = v5*v;
137 v9 = v6*v3;
138 fourpi = 4.*LAL_PI;
139
140 /*--------------------------------------------------------------------*/
141 /* The Expression for dv/dt in the code is simplied after */
142 /* evaluating all the fractions so as to speed of the code */
143 /* The PN expansion from which it results is given by: dv/dt = */
144 /* (32*v^9*\[Eta]*(1 + 4*Pi*v^3 + v^2*(-743/336 - (11*\[Eta])/4) */
145 /* + v^5*((-4159*Pi)/672 - (189*Pi*\[Eta])/8) */
146 /* + v^4*(34103/18144 + (13661*\[Eta])/2016 + (59*\[Eta]^2)/18) */
147 /* + v^7*((-4415*Pi)/4032 + (358675*Pi*\[Eta])/6048 */
148 /* + (91495*Pi*\[Eta]^2)/1512) + v^6*(16447322263/139708800 */
149 /* - (1712*EulerGamma)/105 + (16*Pi^2)/3 - (56198689*\[Eta])/217728 */
150 /* + (451*Pi^2*\[Eta])/48 + (541*\[Eta]^2)/896 - (5605*\[Eta]^3)/2592 */
151 /* - (856*Log[16])/105 - (1712*Log[v])/105)))/5 */
152 /*--------------------------------------------------------------------*/
153
154 dvalues->data[0] = 6.4*v9*eta/ak->totalmass*(1.
155 + v2*(-2.2113095238095237 - 2.75*eta) + v3*fourpi
156 + v4*(1.8795745149911816 + 6.77628968*eta + 3.27777778*eta2)
157 + v5*(-6.1889881*LAL_PI - 23.625*LAL_PI*eta));
158
159 dvalues->data[1] = v3/ak->totalmass;
160}
161
163 REAL8Vector *values,
164 REAL8Vector *dvalues,
165 void *funcParams
166)
167{
169 REAL8 v, v2, v3, v4, v5, v6, v9, eta, eta2, eta3, pisq, fourpi;
170
171 ak = (InspiralDerivativesIn *) funcParams;
172 eta = ak->coeffs->eta;
173
174 v = values->data[0];
175 eta2 = eta * eta;
176 eta3 = eta2 * eta;
177 v2 = v*v;
178 v3 = v2*v;
179 v4 = v3*v;
180 v5 = v4*v;
181 v6 = v5*v;
182 v9 = v6*v3;
183 pisq = LAL_PI*LAL_PI;
184 fourpi = 4.*LAL_PI;
185
186 /*--------------------------------------------------------------------*/
187 /* The Expression for dv/dt in the code is simplied after */
188 /* evaluating all the fractions so as to speed of the code */
189 /* The PN expansion from which it results is given by: dv/dt = */
190 /* (32*v^9*\[Eta]*(1 + 4*Pi*v^3 + v^2*(-743/336 - (11*\[Eta])/4) */
191 /* + v^5*((-4159*Pi)/672 - (189*Pi*\[Eta])/8) */
192 /* + v^4*(34103/18144 + (13661*\[Eta])/2016 + (59*\[Eta]^2)/18) */
193 /* + v^7*((-4415*Pi)/4032 + (358675*Pi*\[Eta])/6048 */
194 /* + (91495*Pi*\[Eta]^2)/1512) + v^6*(16447322263/139708800 */
195 /* - (1712*EulerGamma)/105 + (16*Pi^2)/3 - (56198689*\[Eta])/217728 */
196 /* + (451*Pi^2*\[Eta])/48 + (541*\[Eta]^2)/896 - (5605*\[Eta]^3)/2592 */
197 /* - (856*Log[16])/105 - (1712*Log[v])/105)))/5 */
198 /*--------------------------------------------------------------------*/
199
200 dvalues->data[0] = 6.4*v9*eta/ak->totalmass*(1.
201 + v2*(-2.2113095238095237 - 2.75*eta) + v3*fourpi
202 + v4*(1.8795745149911816 + 6.77628968*eta + 3.27777778*eta2)
203 + v5*(-6.1889881*LAL_PI - 23.625*LAL_PI*eta)
204 + v6*(117.72574285227559 - 16.3047619*0.577215664901
205 + 5.3333333*pisq - 258.114202*eta
206 + 9.39583333*pisq*eta + 0.603794643*eta2
207 - 2.16242284*eta3 - 8.15238095*log(16*v2)));
208
209 dvalues->data[1] = v3/ak->totalmass;
210}
211
213 REAL8Vector *values,
214 REAL8Vector *dvalues,
215 void *funcParams
216)
217{
219 REAL8 v, v2, v3, v4, v5, v6, v7, v9, eta, eta2, eta3, pisq, fourpi;
220
221 ak = (InspiralDerivativesIn *) funcParams;
222 eta = ak->coeffs->eta;
223
224 v = values->data[0];
225 eta2 = eta * eta;
226 eta3 = eta2 * eta;
227 v2 = v*v;
228 v3 = v2*v;
229 v4 = v3*v;
230 v5 = v4*v;
231 v6 = v5*v;
232 v7 = v6*v;
233 v9 = v6*v3;
234 pisq = LAL_PI*LAL_PI;
235 fourpi = 4.*LAL_PI;
236
237 /*--------------------------------------------------------------------*/
238 /* The Expression for dv/dt in the code is simplied after */
239 /* evaluating all the fractions so as to speed of the code */
240 /* The PN expansion from which it results is given by: dv/dt = */
241 /* (32*v^9*\[Eta]*(1 + 4*Pi*v^3 + v^2*(-743/336 - (11*\[Eta])/4) */
242 /* + v^5*((-4159*Pi)/672 - (189*Pi*\[Eta])/8) */
243 /* + v^4*(34103/18144 + (13661*\[Eta])/2016 + (59*\[Eta]^2)/18) */
244 /* + v^7*((-4415*Pi)/4032 + (358675*Pi*\[Eta])/6048 */
245 /* + (91495*Pi*\[Eta]^2)/1512) + v^6*(16447322263/139708800 */
246 /* - (1712*EulerGamma)/105 + (16*Pi^2)/3 - (56198689*\[Eta])/217728 */
247 /* + (451*Pi^2*\[Eta])/48 + (541*\[Eta]^2)/896 - (5605*\[Eta]^3)/2592 */
248 /* - (856*Log[16])/105 - (1712*Log[v])/105)))/5 */
249 /*--------------------------------------------------------------------*/
250
251 dvalues->data[0] = 6.4*v9*eta/ak->totalmass*(1.
252 + v2*(-2.2113095238095237 - 2.75*eta)
253 + v3*fourpi
254 + v4*(1.8795745149911816 + 6.77628968*eta
255 + 3.27777778*eta2)
256 + v5*(-6.1889881*LAL_PI - 23.625*LAL_PI*eta)
257 + v6*(117.72574285227559 - 16.3047619*0.577215664901
258 + 5.3333333*pisq - 258.114202*eta
259 + 9.39583333*pisq*eta + 0.603794643*eta2
260 - 2.16242284*eta3 - 8.15238095*log(16*v2))
261 + v7*(-1.09499008*LAL_PI + 59.3047288*LAL_PI*eta
262 + 60.5125661*LAL_PI*eta2));
263
264 dvalues->data[1] = v3/ak->totalmass;
265}
266
267
270 REAL4Vector *signalvec,
272 )
273{
274
275 InspiralInit paramsInit;
276 UINT4 count;
279
280 ASSERT(signalvec, status,
281 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
282 ASSERT(signalvec->data, status,
283 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
285 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
286 ASSERT(params->nStartPad >= 0, status,
287 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
288 ASSERT(params->nEndPad >= 0, status,
289 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
290 ASSERT(params->fLower > 0, status,
291 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
292 ASSERT(params->tSampling > 0, status,
293 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
294 ASSERT(params->totalMass > 0., status,
295 LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
296
297 LALInspiralSetup (status->statusPtr, &(paramsInit.ak), params);
299 LALInspiralChooseModel(status->statusPtr, &(paramsInit.func),
300 &(paramsInit.ak), params);
302
303 memset(signalvec->data, 0, signalvec->length * sizeof( REAL4 ));
304
305 /* Call the engine function */
306 LALTaylorT4WaveformEngine(status->statusPtr, signalvec,
307 NULL, NULL, NULL, NULL, &count, params, &paramsInit);
309
311 RETURN(status);
312}
313
314void
317 REAL4Vector *signalvec1,
318 REAL4Vector *signalvec2,
320 )
321
322{
323
324 UINT4 count;
325
326 InspiralInit paramsInit;
327
330
331 ASSERT(signalvec1, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
332 ASSERT(signalvec2, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
333 ASSERT(signalvec1->data, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
334 ASSERT(signalvec2->data, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
335 ASSERT(params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
336 ASSERT(params->nStartPad >= 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
337 ASSERT(params->fLower > 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
338 ASSERT(params->tSampling > 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
339
340 /* Compute some parameters*/
341 LALInspiralInit(status->statusPtr, params, &paramsInit);
343
344 /* Initialise the waveforms to zero */
345 memset(signalvec1->data, 0, signalvec1->length * sizeof(REAL4));
346 memset(signalvec2->data, 0, signalvec2->length * sizeof(REAL4));
347
348 /* Call the engine function */
349 LALTaylorT4WaveformEngine(status->statusPtr, signalvec1, signalvec2, NULL, NULL,
350 NULL, &count, params, &paramsInit);
351
353
355 RETURN(status);
356}
357
358void
361 CoherentGW *waveform,
363 PPNParamStruc *ppnParams
364 )
365{
366 UINT4 count, i;
367 REAL8 phiC;
368
369 REAL4Vector *a = NULL; /* pointers to generated amplitude data */
370 REAL4Vector *ff = NULL; /* pointers to generated frequency data */
371 REAL8Vector *phi = NULL; /* pointer to generated phase data */
372
373 InspiralInit paramsInit;
374
375
378
379 /* Make sure parameter and waveform structures exist. */
380 ASSERT( params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
381 ASSERT(waveform, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
382 ASSERT( !( waveform->a ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
383 ASSERT( !( waveform->h ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
384 ASSERT( !( waveform->f ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
385 ASSERT( !( waveform->phi ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
386
387 params->ampOrder = (LALPNOrder) 0;
388 XLALPrintInfo( "WARNING: Amp Order has been reset to %d", params->ampOrder);
389
390 /* Compute some parameters*/
391 LALInspiralInit(status->statusPtr, params, &paramsInit);
393
394 if (paramsInit.nbins == 0)
395 {
396 XLALPrintError( "Error: Estimated length of injection is zero.\n" );
397 ABORT( status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE );
398 }
399
400 /* Now we can allocate memory and vector for coherentGW structure*/
401 ff = XLALCreateREAL4Vector( paramsInit.nbins );
402 a = XLALCreateREAL4Vector( 2*paramsInit.nbins );
403 phi = XLALCreateREAL8Vector( paramsInit.nbins );
404 if ( !ff || !a || !phi )
405 {
406 if ( ff )
408 if ( a )
410 if ( phi )
412 ABORTXLAL( status );
413 }
414
415 /* Call the engine function */
416 LALTaylorT4WaveformEngine(status->statusPtr, NULL, NULL, a, ff,
417 phi, &count, params, &paramsInit);
419 {
423 }
424 ENDFAIL( status );
425
426 /*wrap the phase vector*/
427 phiC = phi->data[count-1] ;
428 for (i = 0; i < count; i++)
429 {
430 phi->data[i] = phi->data[i] - phiC + ppnParams->phi;
431 }
432
433 /* Allocate the waveform structures. */
434 if ( ( waveform->a = (REAL4TimeVectorSeries *)
435 LALCalloc(1, sizeof(REAL4TimeVectorSeries) ) ) == NULL )
436 {
441 LALINSPIRALH_MSGEMEM );
442 }
443 if ( ( waveform->f = (REAL4TimeSeries *)
444 LALCalloc(1, sizeof(REAL4TimeSeries) ) ) == NULL )
445 {
446 LALFree( waveform->a ); waveform->a = NULL;
451 LALINSPIRALH_MSGEMEM );
452 }
453 if ( ( waveform->phi = (REAL8TimeSeries *)
454 LALCalloc(1, sizeof(REAL8TimeSeries) ) ) == NULL )
455 {
456 LALFree( waveform->a ); waveform->a = NULL;
457 LALFree( waveform->f ); waveform->f = NULL;
462 LALINSPIRALH_MSGEMEM );
463 }
464
465 waveform->a->data = XLALCreateREAL4VectorSequence( (UINT4)count, 2 );
466 waveform->f->data = XLALCreateREAL4Vector( count );
467 waveform->phi->data = XLALCreateREAL8Vector( count );
468
469 if ( !waveform->a->data || !waveform->f->data || !waveform->phi->data )
470 {
471 if ( waveform->a->data )
473 if ( waveform->f->data )
474 XLALDestroyREAL4Vector( waveform->f->data );
475 if ( waveform->phi->data )
476 XLALDestroyREAL8Vector( waveform->phi->data );
477 LALFree( waveform->a ); waveform->a = NULL;
478 LALFree( waveform->f ); waveform->f = NULL;
482 ABORTXLAL( status );
483 }
484
485 memcpy(waveform->f->data->data , ff->data, count*(sizeof(REAL4)));
486 memcpy(waveform->a->data->data , a->data, 2*count*(sizeof(REAL4)));
487 memcpy(waveform->phi->data->data ,phi->data, count*(sizeof(REAL8)));
488
489 waveform->a->deltaT = waveform->f->deltaT = waveform->phi->deltaT
490 = ppnParams->deltaT;
491
492 waveform->a->sampleUnits = lalStrainUnit;
493 waveform->f->sampleUnits = lalHertzUnit;
495 waveform->position = ppnParams->position;
496 waveform->psi = ppnParams->psi;
497
498 snprintf( waveform->a->name, LALNameLength, "T4 inspiral amplitude" );
499 snprintf( waveform->f->name, LALNameLength, "T4 inspiral frequency" );
500 snprintf( waveform->phi->name, LALNameLength, "T4 inspiral phase" );
501
502 /* --- fill some output ---*/
503 ppnParams->tc = (double)(count-1) / params->tSampling ;
504 ppnParams->length = count;
505 ppnParams->dfdt = ((REAL4)(waveform->f->data->data[count-1]
506 - waveform->f->data->data[count-2])) * ppnParams->deltaT;
507 ppnParams->fStop = params->fFinal;
509 ppnParams->termDescription = GENERATEPPNINSPIRALH_MSGEFSTOP;
510
511 ppnParams->fStart = ppnParams->fStartIn;
512
513
514 /* --- free memory --- */
518
520 RETURN (status);
521}
522
523/*---------------------------------------------------------*/
524void
527 REAL4Vector *signalvec1,
528 REAL4Vector *signalvec2,
529 REAL4Vector *a,
530 REAL4Vector *ff,
531 REAL8Vector *phiVec,
532 UINT4 *countback,
534 InspiralInit *paramsInit
535 )
536{
537
538 void *funcParams;
539 UINT4 length=0, count, ndx;
540 INT4 nn=2;
541 REAL8 omega, omegaMax, t, dt, m, phi, v;
542 REAL8Vector dummy, values, dvalues, newvalues, yt, dym, dyt;
543 rk4GSLIntegrator *integrator = NULL;
545 rk4In in4;
546 expnCoeffs ak;
547 expnFunc func;
548 /*DFindRootIn rootIn;*/
549 CHAR message[256];
550
551 /* Variables for injection */
552 REAL8 mTot = 0;
553 REAL8 unitHz = 0;
554 REAL8 f2a = 0;
555 REAL8 mu = 0;
556 REAL8 cosI = 0;/* cosine of system inclination */
557 REAL8 etab = 0;
558 REAL8 fFac = 0; /* SI normalization for f and t */
559 REAL8 f2aFac = 0;/* factor multiplying f in amplitude function */
560 REAL8 apFac = 0, acFac = 0;/* extra factor in plus and cross amplitudes */
561
562
565
566 ASSERT( signalvec1 || ( ff && a && phiVec ), status,
567 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
568
570 LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
571
573 LALINSPIRALH_EDIV0, LALINSPIRALH_MSGEDIV0 );
574
575/* Allocate all the memory required to dummy and then point the various
576 arrays to dummy - this makes it easier to handle memory failures */
577
578 dummy.length = nn * 6;
579
580 if (!(dummy.data = (REAL8 * ) LALMalloc(sizeof(REAL8) * nn * 6))) {
581 ABORT(status, LALINSPIRALH_EMEM, LALINSPIRALH_MSGEMEM);
582 }
583
584 values.length = nn;
585 dvalues.length = nn;
586 newvalues.length = nn;
587 yt.length = nn;
588 dym.length = nn;
589 dyt.length = nn;
590
591 values.data = &dummy.data[0];
592 dvalues.data = &dummy.data[nn];
593 newvalues.data = &dummy.data[2*nn];
594 yt.data = &dummy.data[3*nn];
595 dym.data = &dummy.data[4*nn];
596 dyt.data = &dummy.data[5*nn];
597
598
599 mTot = params->mass1 + params->mass2;
600 etab = params->mass1 * params->mass2;
601 etab /= mTot;
602 etab /= mTot;
603 unitHz = mTot *LAL_MTSUN_SI*(REAL8)LAL_PI;
604 cosI = cos( params->inclination );
605 mu = etab * mTot;
606 fFac = 1.0 / ( 4.0*LAL_TWOPI*LAL_MTSUN_SI*mTot );
607 f2aFac = LAL_PI*LAL_MTSUN_SI*mTot*fFac;
608 apFac = acFac = -2.0 * mu * LAL_MRSUN_SI/params->distance;
609 apFac *= 1.0 + cosI*cosI;
610 acFac *= 2.0*cosI;
611 params->nStartPad = 0;
612
613 /* Set dt to sampling interval specified by user */
614
615 dt = 1./params->tSampling;
616 ak = paramsInit->ak;
617 func = paramsInit->func;
618 if ( signalvec1 )
619 {
620 length = signalvec1->length;
621 }
622 else
623 {
624 length = ff->length;
625 }
626 // UNUSED!!: eta = ak.eta;
627 m = ak.totalmass;
628
629 /* Begin initial conditions */
630 /* Given omega compute v */
631 omega = LAL_PI*params->fLower;
632 v = pow(m*omega,1./3.);
633 /* End of initial conditions */
634
635 values.data[0] = v;
636 values.data[1] = phi = params->startPhase;
637
638 /* fprintf(stdout, "Initial v=%e, phi=%e\n", values.data[0], values.data[1]); */
639 t = 0.0;
640
641 /* Initialize the GSL integrator */
642 switch (params->order)
643 {
644 case LAL_PNORDER_TWO:
646 break;
649 break;
652 break;
655 break;
656 default:
657 snprintf(message, 256, "There are no T4 waveforms at order %d\n", params->order);
658 LALError( status, message );
659 LALFree(dummy.data);
660 ABORT( status, LALINSPIRALH_ECHOICE, LALINSPIRALH_MSGECHOICE);
661 }
662
663 in4.y = &values;
664 in4.h = dt;
665 in4.n = nn;
666 in4.yt = &yt;
667 in4.dym = &dym;
668 in4.dyt = &dyt;
669 in4.x = 0.;
670
671 if (!(integrator = XLALRungeKutta4Init(nn, &in4)))
672 {
673 LALFree(dummy.data);
674 ABORT(status, LALINSPIRALH_EMEM, LALINSPIRALH_MSGEMEM);
675 }
676
677 in2.totalmass = ak.totalmass;
678 in2.dEnergy = func.dEnergy;
679 in2.flux = func.flux;
680 in2.coeffs = &ak;
681 funcParams = (void *) &in2;
682 /* Calculate the initial value of omega */
683 in4.function(&values, &dvalues, funcParams);
684
685 /* Begin integration loop here */
686
687 omegaMax = 1./(pow(6.,1.5)*m);
688 t = 0.0;
689 ndx = 0;
690 count = 0;
691
692 /* fprintf(stdout, "fMin=%e, fMax=%e, dv/dt=%e, dphi/dt=%e\n", */
693 /* omega/LAL_PI, omegaMax/LAL_PI, */
694 /* dvalues.data[0], dvalues.data[1]); */
695
696 while (omega<omegaMax)
697 {
698 if (count >= length)
699 {
700 XLALRungeKutta4Free( integrator );
701 LALFree(dummy.data);
702 ABORT(status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
703 }
704
705 // UNUSED!!: REAL8 h = 4 * m * eta * v*v * cos(2.*phi);
706 if ( signalvec1 )
707 {
708 signalvec1->data[ndx] = apFac * v*v * cos(2.*phi);
709 if ( signalvec2 )
710 {
711 signalvec2->data[ndx] = apFac * v*v * cos(2.*phi + LAL_PI_2);
712 }
713 }
714 else if (a)
715 {
716 int ice, ico;
717 ice = 2*count;
718 ico = ice + 1;
719 omega = v*v*v;
720
721 ff->data[count] = (REAL4)(omega/unitHz);
722 f2a = pow (f2aFac * omega, 2./3.);
723 a->data[ice] = (REAL4)(4.*apFac * f2a);
724 a->data[ico] = (REAL4)(4.*acFac * f2a);
725 phiVec->data[count] = (REAL8)(2.0 * phi);
726 }
727 /* fprintf(stdout, "%e %e %e\n", t, h, omega/(2.*m*LAL_PI)); */
728
729 /* Integrate one step forward */
730 in4.dydx = &dvalues;
731 in4.x = t;
732 LALRungeKutta4(status->statusPtr, &newvalues, integrator, funcParams);
734 {
735 XLALRungeKutta4Free( integrator );
736 LALFree(dummy.data);
737 }
738 ENDFAIL( status );
739
740 /* Update the values of the dynamical variables */
741 v = values.data[0] = newvalues.data[0];
742 phi = values.data[1] = newvalues.data[1];
743
744 /* Compute the derivaties at the new location */
745 in4.function(&values, &dvalues, funcParams);
746 omega = dvalues.data[1];
747
748 t = (++count-params->nStartPad) * dt;
749 ndx++;
750 }
751
752 /*----------------------------------------------------------------------*/
753 /* Record the final cutoff frequency of BD Waveforms for record keeping */
754 /* ---------------------------------------------------------------------*/
755 *countback = count;
756 v = pow(m*omega, 1./3.);
757 params->vFinal = v;
758 params->tC = t;
759 params->fFinal = omega/LAL_PI;
760 /* fprintf(stdout, "Final velocity=%e, time=%e, frequency=%e\n", v, t, params->fFinal); */
761
762 XLALRungeKutta4Free( integrator );
763 LALFree(dummy.data);
764
766 RETURN(status);
767}
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)
void LALTaylorT4WaveformEngine(LALStatus *status, REAL4Vector *signalvec1, REAL4Vector *signalvec2, REAL4Vector *a, REAL4Vector *ff, REAL8Vector *phi, UINT4 *countback, InspiralTemplate *params, InspiralInit *paramsInit)
void LALTaylorT4Derivatives4PN(REAL8Vector *values, REAL8Vector *dvalues, void *funcParams)
void LALTaylorT4Derivatives5PN(REAL8Vector *values, REAL8Vector *dvalues, void *funcParams)
void LALTaylorT4Derivatives7PN(REAL8Vector *values, REAL8Vector *dvalues, void *funcParams)
void LALTaylorT4Waveform(LALStatus *status, REAL4Vector *signalvec, InspiralTemplate *params)
void LALTaylorT4Derivatives6PN(REAL8Vector *values, REAL8Vector *dvalues, void *funcParams)
void LALTaylorT4WaveformTemplates(LALStatus *status, REAL4Vector *signalvec1, REAL4Vector *signalvec2, InspiralTemplate *params)
void LALTaylorT4WaveformForInjection(LALStatus *status, CoherentGW *waveform, InspiralTemplate *params, PPNParamStruc *ppnParams)
#define LALCalloc(m, n)
#define LALMalloc(n)
#define LALFree(p)
#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)
double i
void XLALDestroyREAL4VectorSequence(REAL4VectorSequence *vecseq)
REAL4VectorSequence * XLALCreateREAL4VectorSequence(UINT4 length, UINT4 veclen)
#define GENERATEPPNINSPIRALH_EFSTOP
Reached requested termination frequency.
#define LAL_PI_2
#define LAL_PI
#define LAL_TWOPI
#define LAL_MTSUN_SI
#define LAL_MRSUN_SI
double REAL8
char CHAR
uint32_t UINT4
int32_t INT4
float REAL4
LALNameLength
int LALError(LALStatus *status, const char *statement)
#define LALINSPIRALH_ECHOICE
Invalid choice for an input parameter.
Definition: LALInspiral.h:60
#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_EDIV0
Division by zero.
Definition: LALInspiral.h:58
#define LALINSPIRALH_ESIZE
Invalid input range.
Definition: LALInspiral.h:59
LALPNOrder
LAL_PNORDER_TWO_POINT_FIVE
LAL_PNORDER_THREE
LAL_PNORDER_TWO
LAL_PNORDER_THREE_POINT_FIVE
static const INT4 m
static const INT4 a
const LALUnit lalStrainUnit
const LALUnit lalHertzUnit
const LALUnit lalDimensionlessUnit
REAL4Vector * XLALCreateREAL4Vector(UINT4 length)
void XLALDestroyREAL4Vector(REAL4Vector *vector)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
list mu
SkyPosition position
REAL4TimeVectorSeries * a
REAL8TimeSeries * phi
REAL4TimeVectorSeries * h
REAL4TimeSeries * f
Structure used as an input to compute the derivatives needed in solving the phasing formula when the ...
Definition: LALInspiral.h:607
EnergyFunction * dEnergy
Definition: LALInspiral.h:609
FluxFunction * flux
Definition: LALInspiral.h:610
expnCoeffs * coeffs
Definition: LALInspiral.h:611
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
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 totalmass
Definition: LALInspiral.h:474
Structure to hold the pointers to the generic functions defined above.
Definition: LALInspiral.h:546
EnergyFunction * dEnergy
Definition: LALInspiral.h:547
FluxFunction * flux
Definition: LALInspiral.h:548
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