Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
b574ee77
Commit
b574ee77
authored
Sep 13, 2017
by
Bruce Allen
Browse files
Removed two phase output
parent
c32e9fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/antenna.c
View file @
b574ee77
// Copyright Bruce Allen 2017
// Compile with gcc -o antenna antenna.c -lm
// REMAINING THINGS TO CHECK:
// (a) sign conventions for h, which arm is positive
// (b) direction and origin conventions for the polarization axis
// (c) double check the hand calculations
#include
<math.h>
#include
<stdio.h>
#include
<stdlib.h>
...
...
@@ -176,21 +181,21 @@ void populate_detectors(){
// LLO
// Sanity checked using Google Earth!
strcpy
(
detectors
[
0
].
name
,
"LLO"
);
strcpy
(
detectors
[
0
].
name
,
"
LLO
"
);
detectors
[
0
].
location
[
0
]
=
30
.
56
*
deg_to_rad
;
detectors
[
0
].
location
[
1
]
=
-
90
.
77
*
deg_to_rad
;
detectors
[
0
].
orientation
=
198
.
0
*
deg_to_rad
;
// LHO
// Sanity checked using Google Earth!
strcpy
(
detectors
[
1
].
name
,
"LHO"
);
strcpy
(
detectors
[
1
].
name
,
"
LHO
"
);
detectors
[
1
].
location
[
0
]
=
46
.
45
*
deg_to_rad
;
detectors
[
1
].
location
[
1
]
=
-
119
.
41
*
deg_to_rad
;
detectors
[
1
].
orientation
=
126
.
8
*
deg_to_rad
;
// VIRGO
// Sanity checked using Google Earth!
strcpy
(
detectors
[
2
].
name
,
"V
irgo
"
);
strcpy
(
detectors
[
2
].
name
,
"V
IRGO
"
);
detectors
[
2
].
location
[
0
]
=
43
.
63
*
deg_to_rad
;
detectors
[
2
].
location
[
1
]
=
10
.
5
*
deg_to_rad
;
detectors
[
2
].
orientation
=
71
.
5
*
deg_to_rad
;
...
...
@@ -332,24 +337,21 @@ int main(int argc, char *argv[]) {
// form combinations as functions of inclination and polarization angles
X
=
2
.
0
*
ci
*
(
alpha
*
s2p
-
beta
*
c2p
);
Y
=
-
(
ci
*
ci
+
1
.
0
)
*
(
alpha
*
c2p
+
beta
*
s2p
);
// compute time delay
dt
*=
radius_earth
;
printf
(
"For detector %s the waveform is w^2 [ %.3f sin(2w(t%+.3f s))%+.3f cos(2w(t%+.3f s)) ]
\n
"
,
detectors
[
i
].
name
,
X
,
dt
,
Y
,
dt
);
//
printf("For detector %s the waveform is w^2 [ %.3f sin(2w(t%+.3f s))%+.3f cos(2w(t%+.3f s)) ]\n", detectors[i].name, X, dt, Y, dt);
// compute alternative form of output
// X sin(phi) + Y cos(phi) = sqrt(X^2+Y^2) sin(phi + ang) where ang=atan2(Y,X)
double
amp
=
sqrt
(
X
*
X
+
Y
*
Y
);
double
ang
=
atan2
(
Y
,
X
);
double
ang
=
180
.
0
*
atan2
(
Y
,
X
)
/
M_PI
;
// degree character in UTF-8 character set (most likely terminal type!)
int
deg1
=
0xC2
,
deg2
=
0xB0
;
printf
(
" = %.3f w^2 cos[2w(t%+.3f s) %+.1f%c%c]
\n
"
,
amp
,
dt
,
ang
,
deg1
,
deg2
);
printf
(
"For detector %s the waveform is %.3f w^2 sin(2w[t%+.3f s]%+.1f%c%c)
\n
"
,
detectors
[
i
].
name
,
amp
,
dt
,
ang
,
deg1
,
deg2
);
}
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment