00001 /* 00002 * Copyright (C) 2007 Reinhard Prix, Teviet Creighton 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with with program; see the file COPYING. If not, write to the 00016 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00017 * MA 02111-1307 USA 00018 */ 00019 00020 /************************** <lalVerbatim file="GenerateSpinOrbitCWHV"> 00021 Author: Creighton, T. D. 00022 $Id: GenerateSpinOrbitCW.h,v 1.6 2007/06/08 14:41:46 bema Exp $ 00023 **************************************************** </lalVerbatim> */ 00024 00025 /********************************************************** <lalLaTeX> 00026 00027 \section{Header \texttt{GenerateSpinOrbitCW.h}} 00028 \label{s:GenerateSpinOrbitCW.h} 00029 00030 Provides routines to generate continuous waveforms with spindown and 00031 orbital modulation. 00032 00033 \subsection*{Synopsis} 00034 \begin{verbatim} 00035 #include <lal/GenerateSpinOrbitCW.h> 00036 \end{verbatim} 00037 00038 This header covers routines to generate continuous quasiperiodic 00039 waveforms with a smoothly-varying intrinsic frequency modulated by 00040 orbital motions around a binary companion. The intrinsic frequency is 00041 modeled by Taylor series coefficients as in \verb@GenerateTaylorCW.h@, 00042 and the orbital modulation is described by a reduced set of orbital 00043 parameters. Note that the routines do \emph{not} account for spin 00044 precession, accretion processes, or other complicating factors; they 00045 simply Doppler-modulate a polynomial frequency function. 00046 00047 The frequency and phase of the wave in the source's rest frame are 00048 given by Eqs.~(\ref{eq:taylorcw-freq}) and~(\ref{eq:taylorcw-phi}) of 00049 \verb@GenerateTaylorCW.h@, where $t$ is the proper time in this rest 00050 frame. The frequency and phase of the wave fronts crossing a 00051 reference point in an inertial frame (e.g.\ the Solar system 00052 barycentre) are simply $f[t(t_r)]$ and $\phi[t(t_r)]$, where 00053 \begin{equation} 00054 \label{eq:spinorbit-tr} 00055 t_r = t + R(t)/c 00056 \end{equation} 00057 is the (retarded) time measured at the inertial reference point a 00058 distance $r$ from the source. 00059 00060 The generation of the waveform thus consists of computing the radial 00061 component $R(t)$ of the orbital motion of the source in the binary 00062 centre-of-mass frame, inverting Eq.~(\ref{eq:spinorbit-tr}) to find 00063 the ``emission time'' $t$ for a given ``detector time'' $t_r$, and 00064 plugging this into the Taylor expansions to generate the instantaneous 00065 frequency and phase. The received frequency is also multiplied by the 00066 instantaneous Doppler shift $[1+\dot{R}(t)/c]^{-1}$ at the time of 00067 emission. 00068 00069 Since we do not include precession effects, the polarization state of 00070 the wave is constant: we simply specify the polarization amplitudes 00071 $A_+$, $A_\times$ and the polarization phase $\psi$ based on the 00072 (constant) orientation of the source's \emph{rotation}. The following 00073 discussion defines a set of parameters for the source's orbital 00074 \emph{revolution}, which we regard as completely independent from its 00075 rotation. 00076 00077 \subsubsection*{Orbital motion} 00078 00079 \begin{wrapfigure}{r}{0.52\textwidth} 00080 \vspace{-4ex} 00081 \begin{center} 00082 \resizebox{0.47\textwidth}{!}{\includegraphics{inject_binary}} \\ 00083 \parbox{0.47\textwidth}{\caption{\label{fig:binary-orbit} Binary orbit 00084 orientation parameters.}} 00085 \end{center} 00086 \vspace{-2ex} 00087 \end{wrapfigure} 00088 Fig.~\ref{fig:binary-orbit} illustrates the notation conventions 00089 defining a binary orbit. We define a radial axis $R$ directed 00090 \emph{from} the observer (Earth) \emph{to} the source, as shown. The 00091 horizontal plane is thus the plane of the sky, and the direction 00092 marked $N$ is the direction along a meridian towards the North 00093 celestial pole. The tilted plane is the plane of the binary orbit, 00094 and the axis labeled $z$ is the normal to this plane directed such 00095 that the orbit is right-handed about this axis. The \emph{ascending 00096 node} of the orbit, denoted by 00097 \raisebox{-0.5pt}{\includegraphics{inject_ascend}}, is the direction 00098 defined by $\hat{\mathbf{\mathit{R}}}\times\hat{\mathbf{\mathit{z}}}$. 00099 The binary orbit itself is shown as an off-centred ellipse, with the 00100 barycentre at one of its foci; the wave-emitting source is also shown. 00101 00102 The \emph{inclination angle} $i$ is the angle between the sky and 00103 orbital planes. The \emph{longitude of the ascending node} $\Omega$ 00104 is the angle in the plane of the sky from the North direction to the 00105 ascending node, measured right-handed about 00106 $\hat{\mathbf{\mathit{R}}}$. The \emph{argument of the periapsis} 00107 $\omega$ is the angle in the orbital plane from the ascending node to 00108 the direction of periapsis (point where the source is closest to the 00109 system barycentre), and the \emph{true anomaly} $\upsilon(t)$ of the 00110 source is the angle from the periapsis to the current location of the 00111 source; both angles are measured right-handed about 00112 $\hat{\mathbf{\mathit{z}}}$ (i.e.\ prograde). The \emph{periapsis 00113 separation} $r_p$ is the distance from the periapsis to the 00114 barycentre, and we denote the \emph{eccentricity} of the orbital 00115 ellipse as $e$, so that the separation between the source and the 00116 barycentre at any time is $r=r_p(1+e)/(1+e\cos\upsilon)$. 00117 00118 In this convention, $i\in[0,\pi]$ and $\Omega\in[0,2\pi)$. Another 00119 convention common in astronomy is to restrict $\Omega$ to the range 00120 $[0,\pi)$, refering to whichever node (ascending or descending) lies 00121 in this range. The argument of the periapsis $\omega$ is then also 00122 measured from this node. In this case the range of $i$ must be 00123 extended to $(-\pi,\pi]$; it is negative if the reference node is 00124 descending, and positive if it is ascending. The formulae that follow 00125 are the same in either convention, though, since one can verify that 00126 adding $\pi$ to $\Omega$ and $\omega$ is equivalent to reversing the 00127 sign on $i$. 00128 00129 Some spherical trigonometry gives us $R=r\sin(\omega+\upsilon)\sin i$. 00130 We can differentiate $R$ with respect to $t$, and apply Keplers 00131 second law 00132 $r^2\dot{\upsilon}=r_p^2\dot{\upsilon}_p=\mathrm{constant}$, where 00133 $\dot{\upsilon}_p$ is the angular speed at periapsis, to get: 00134 \begin{eqnarray} 00135 \label{eq:orbit-r} 00136 R & = & R_0 + \frac{(1+e) r_p\sin i}{1+e\cos\upsilon} 00137 \sin(\omega+\upsilon) \;,\\ 00138 \label{eq:orbit-rdot} 00139 \dot{R} & = & \dot{R}_0 + \frac{\dot{\upsilon}_p r_p\sin i}{1+e} 00140 \left[ \cos(\omega+\upsilon) + e\cos\omega \right] \;. 00141 \end{eqnarray} 00142 Without loss of generality, we will henceforth drop the offsets $R_0$ 00143 and (constant) $\dot{R}_0$ from these equations. This means that we 00144 ignore the overall propagation delay between the $R=R_0$ plane and the 00145 observer, and incorporate any (constant) Doppler shifts due to net 00146 centre-of-mass motions into the values of $f$ and $\dot{\upsilon}_p$. 00147 The resulting times and parameter values are referred to as being in 00148 the \emph{barycentric} frame. The only time delays and Doppler shifts 00149 that we explicitly treat are those arising from the motion of the 00150 source relative to the $R=R_0$ sky plane passing through the system 00151 barycentre. 00152 00153 All we need now to determine the orbital motion is an equation for 00154 $\upsilon(t)$. Many basic astronomy textbooks give exact but 00155 transcendental expressions relating $\upsilon$ and $t$ for elliptical 00156 orbits with $0\leq e<1$, and/or series expansions of $\upsilon(t)$ for 00157 $e\ll1$. However, for a generic binary system we cannot guarantee 00158 that $e\ll1$, and for now we would like to retain the possibility of 00159 modeling open orbits with $e\geq1$. For now we will simply present 00160 the exact formulae, and discuss the numerical solution methods in the 00161 modules under this header. 00162 00163 Let $t_p$ be the time of a periapsis passage (preferably a recent one 00164 in the case of closed orbits). We express both $t$ and $\upsilon$ in 00165 terms of an intermediate variable $E$ (called the \emph{eccentric 00166 anomaly} for elliptic orbits, unnamed for open orbits). The formulae 00167 are: 00168 \begin{equation} 00169 \label{eq:spinorbit-t} 00170 t - t_p = \left\{ \begin{array}{l@{\qquad}c} 00171 \frac{1}{\dot{\upsilon}_p} \sqrt{\frac{1+e}{(1-e)^3}} 00172 \left( E - e\sin E \right) & 0 \leq e < 1 \\ & \\ 00173 \frac{1}{\dot{\upsilon}_p} E 00174 \left( 1 + \frac{E^2}{12} \right) & e = 1 \\ & \\ 00175 \frac{1}{\dot{\upsilon}_p} \sqrt{\frac{e+1}{(e-1)^3}} 00176 \left( e\sinh E - E \right) & e > 1 00177 \end{array} \right. 00178 \end{equation} 00179 \begin{equation} 00180 \label{eq:spinorbit-upsilon} 00181 \begin{array}{c} \tan\left(\frac{\upsilon}{2}\right) \end{array} 00182 = \left\{ \begin{array}{l@{\qquad}c} 00183 \sqrt{\frac{1+e}{1-e}}\tan\left(\frac{E}{2}\right) 00184 & 0 \leq e < 1 \\ & \\ 00185 \frac{E}{2} & e = 1 \\ & \\ 00186 \sqrt{\frac{e+1}{e-1}}\tanh\left(\frac{E}{2}\right) & e > 1 00187 \end{array} \right. 00188 \end{equation} 00189 00190 Thus to solve for $\upsilon(t)$ one typically inverts the equation for 00191 $t-t_p$ numerically or by series expansion, finds the corresponding 00192 $E$, and then plugs this into the expression for $\upsilon$. However, 00193 in our case we would then need to do another numerical inversion to 00194 find the retarded time $t_r$ from Eq.~(\ref{eq:spinorbit-tr}). A more 00195 efficient approach is thus to take an initial guess for $E$, compute 00196 both $t$, $\upsilon$, and hence $t_r$, and then refine directly on 00197 $E$. 00198 00199 \subsubsection*{Other notation conventions} 00200 00201 Since we may deal with highly eccentric or open orbits, we will 00202 specify these orbits with parameters that are definable for all 00203 classes of orbit. Thus we specify the size of the orbit with the 00204 periapsis separation $r_p$ rather than the semimajor axis $a$, and the 00205 speed of the orbit with the angular speed at periapsis 00206 $\dot{\upsilon}_p$ rather than with the period $P$. These parameters 00207 are related by: 00208 \begin{eqnarray} 00209 \label{eq:spinorbit-a} 00210 a & = & \frac{r_p}{1-e} \;,\\ 00211 \label{eq:spinorbit-p} 00212 P & = & \frac{2\pi}{\dot{\upsilon}_p} \sqrt{\frac{1+e}{(1-e)^3}} \;. 00213 \end{eqnarray} 00214 Furthermore, for improved numerical precision when dealing with 00215 near-parabolic orbits, we specify the value of $1-e$ rather than the 00216 value of $e$. We note that $1-e$ has a maximum value of $1$ for a 00217 circular orbit, positive for closed elliptical orbits, zero for 00218 parabolic orbits, and negative (unbounded) for hyperbolic orbits. 00219 00220 ******************************************************* </lalLaTeX> */ 00221 00222 #ifndef _GENERATESPINORBITCW_H 00223 #define _GENERATESPINORBITCW_H 00224 00225 #include <lal/LALStdlib.h> 00226 #include <lal/SimulateCoherentGW.h> 00227 #include <lal/SkyCoordinates.h> 00228 00229 #ifdef __cplusplus 00230 extern "C" { 00231 #pragma } 00232 #endif 00233 00234 NRCSID( GENERATESPINORBITCWH, "$Id: GenerateSpinOrbitCW.h,v 1.6 2007/06/08 14:41:46 bema Exp $" ); 00235 00236 /********************************************************** <lalLaTeX> 00237 \subsection*{Error conditions} 00238 ****************************************** </lalLaTeX><lalErrTable> */ 00239 #define GENERATESPINORBITCWH_ENUL 1 00240 #define GENERATESPINORBITCWH_EOUT 2 00241 #define GENERATESPINORBITCWH_EMEM 3 00242 #define GENERATESPINORBITCWH_EECC 4 00243 #define GENERATESPINORBITCWH_EFTL 5 00244 #define GENERATESPINORBITCWH_ESGN 6 00245 00246 #define GENERATESPINORBITCWH_MSGENUL "Unexpected null pointer in arguments" 00247 #define GENERATESPINORBITCWH_MSGEOUT "Output field a, f, phi, or shift already exists" 00248 #define GENERATESPINORBITCWH_MSGEMEM "Out of memory" 00249 #define GENERATESPINORBITCWH_MSGEECC "Eccentricity out of range" 00250 #define GENERATESPINORBITCWH_MSGEFTL "Periapsis motion is faster than light" 00251 #define GENERATESPINORBITCWH_MSGESGN "Sign error: positive parameter expected" 00252 /******************************************** </lalErrTable><lalLaTeX> 00253 00254 \subsection*{Types} 00255 00256 \subsubsection*{Structure \texttt{SpinOrbitCWParamStruc}} 00257 \idx[Type]{SpinOrbitCWParamStruc} 00258 00259 This structure stores the parameters for constructing a gravitational 00260 waveform with both a Taylor-polynomial intrinsic frequency and phase, 00261 and a binary-orbit modulation. As with the \verb@PPNParamStruc@ type 00262 in \verb@GeneratePPNInspiral.h@, we divide the fields into passed 00263 fields (which are supplied to the final \verb@CoherentGW@ structure 00264 but not used in any calculations), input fields (that are used by the 00265 waveform generator), and output fields (that are set by the waveform 00266 generator). They are: 00267 00268 \bigskip\noindent\textit{Passed fields:} 00269 \begin{description} 00270 \item[\texttt{SkyPosition position}] The location of the source on the 00271 sky, normally in equatorial coordinates. 00272 00273 \item[\texttt{REAL4 psi}] The polarization angle of the source, in 00274 radians. 00275 \end{description} 00276 00277 \medskip\noindent\textit{Input fields:} 00278 \begin{description} 00279 \item[\texttt{LIGOTimeGPS epoch}] The start time of the output series. 00280 00281 \item[\texttt{LIGOTimeGPS spinEpoch}] A reference time 00282 $t_\mathrm{ref}$ (in the barycentric frame) at which the rotational 00283 properties of the source are specified. 00284 00285 \item[\texttt{LIGOTimeGPS orbitEpoch}] A time $t_\mathrm{peri}$ (in 00286 the barycentric frame) at which the source passes through periapsis. 00287 Note that this is the proper or ``true'' time of passage; the 00288 \emph{observed} periapsis passage occurs at time 00289 $t_\mathrm{peri}+r(t_\mathrm{peri})/c$. 00290 00291 \item[\texttt{REAL8 deltaT}] The requested sampling interval of the 00292 waveform, in s. 00293 00294 \item[\texttt{UINT4 length}] The number of samples in the generated 00295 waveform. 00296 00297 \item[\texttt{REAL4 aPlus, aCross}] The polarization amplitudes $A_+$, 00298 $A_\times$, in dimensionless strain units. 00299 00300 \item[\texttt{REAL8 phi0}] The phase of the wave emitted at time 00301 $t_\mathrm{ref}$, in radians. 00302 00303 \item[\texttt{REAL8 f0}] The frequency of the wave emitted at time 00304 $t_\mathrm{ref}$ (and incorporating any Doppler shift due to 00305 $\dot{R}_0$), in Hz. 00306 00307 \item[\texttt{REAL8Vector *f}] The spin-normalized Taylor parameters 00308 $f_k$, as defined in Eq.~\ref{eq:taylorcw-freq} of 00309 \verb@GenerateTaylorCW.h@. If \verb@f@=\verb@NULL@, the (proper) spin 00310 of the source is assumed to be constant. 00311 00312 \item[\texttt{REAL8 omega}] The argument of the periapsis, $\omega$, 00313 in radians. 00314 00315 \item[\texttt{REAL8 rPeriNorm}] The projected, 00316 speed-of-light-normalized periapsis separation of the orbit, 00317 $(r_p/c)\sin i$, in s. 00318 00319 \item[\texttt{REAL8 oneMinusEcc}] The value of $1-e$. 00320 00321 \item[\texttt{REAL8 angularSpeed}] The angular speed at periapsis, 00322 $\dot{\upsilon}_p$, in Hz. 00323 \end{description} 00324 00325 \medskip\noindent\textit{Output fields:} 00326 \begin{description} 00327 \item[\texttt{REAL4 dfdt}] The maximum value of $\Delta f\Delta t$ 00328 encountered over any timestep $\Delta t$ used in generating the 00329 waveform. 00330 \end{description} 00331 00332 ******************************************************* </lalLaTeX> */ 00333 00334 /** 00335 * This structure stores the parameters for constructing a gravitational 00336 * waveform with both a Taylor-polynomial intrinsic frequency and phase, 00337 * and a binary-orbit modulation. As with the PPNParamStruc type 00338 * in GeneratePPNInspiral.h, we divide the fields into passed 00339 * fields (which are supplied to the final CoherentGW structure 00340 * but not used in any calculations), input fields (that are used by the 00341 * waveform generator), and output fields (that are set by the waveform 00342 * generator). 00343 */ 00344 typedef struct tagSpinOrbitCWParamStruc { 00345 /* Passed parameters. */ 00346 SkyPosition position; /**< location of source on sky */ 00347 REAL4 psi; /**< polarization angle (radians) */ 00348 00349 /* Input parameters. */ 00350 LIGOTimeGPS epoch; /**< start time of output time series */ 00351 LIGOTimeGPS spinEpoch; /**< reference time for rotational parameters */ 00352 LIGOTimeGPS orbitEpoch; /**< time of a periapsis passage */ 00353 REAL8 deltaT; /**< requested sampling interval (s) */ 00354 UINT4 length; /**< length of time series */ 00355 REAL4 aPlus, aCross; /**< polarization amplitudes */ 00356 REAL8 phi0; /**< initial phase (radians) */ 00357 REAL8 f0; /**< initial frequency (Hz) */ 00358 REAL8Vector *f; /**< f0-normalized Taylor parameters */ 00359 REAL8 omega; /**< argument of periapsis (radians) */ 00360 REAL8 rPeriNorm; /**< projected, normalized periapsis (s) */ 00361 REAL8 oneMinusEcc; /**< 1 - orbital eccentricity */ 00362 REAL8 angularSpeed; /**< angular speed at periapsis (Hz) */ 00363 00364 /* Output parameters. */ 00365 REAL4 dfdt; /**< [OUT:] maximum value of df*dt over any timestep */ 00366 } SpinOrbitCWParamStruc; 00367 00368 00369 /* <lalLaTeX> 00370 \vfill{\footnotesize\input{GenerateSpinOrbitCWHV}} 00371 </lalLaTeX> */ 00372 00373 00374 /* Function prototypes. */ 00375 00376 /* <lalLaTeX> 00377 \newpage\input{GenerateSpinOrbitCWC} 00378 </lalLaTeX> */ 00379 void 00380 LALGenerateSpinOrbitCW( LALStatus *, 00381 CoherentGW *output, 00382 SpinOrbitCWParamStruc *params ); 00383 00384 /* <lalLaTeX> 00385 \newpage\input{GenerateEllipticSpinOrbitCWC} 00386 </lalLaTeX> */ 00387 void 00388 LALGenerateEllipticSpinOrbitCW( LALStatus *, 00389 CoherentGW *output, 00390 SpinOrbitCWParamStruc *params ); 00391 00392 /* <lalLaTeX> 00393 \newpage\input{GenerateParabolicSpinOrbitCWC} 00394 </lalLaTeX> */ 00395 void 00396 LALGenerateParabolicSpinOrbitCW( LALStatus *, 00397 CoherentGW *output, 00398 SpinOrbitCWParamStruc *params ); 00399 00400 /* <lalLaTeX> 00401 \newpage\input{GenerateHyperbolicSpinOrbitCWC} 00402 </lalLaTeX> */ 00403 void 00404 LALGenerateHyperbolicSpinOrbitCW( LALStatus *, 00405 CoherentGW *output, 00406 SpinOrbitCWParamStruc *params ); 00407 00408 /* <lalLaTeX> 00409 %\newpage\input{SimulateSpinOrbitCWTestC} 00410 </lalLaTeX> */ 00411 00412 #ifdef __cplusplus 00413 #pragma { 00414 } 00415 #endif 00416 00417 #endif /* _GENERATESPINORBITCW_H */
1.5.2