| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | satellite outage program |
I just wrote this little thing. It's supposed to calculate the dates
and times when any geostationary satellite appears to pass in front of
the sun, as seen from anywhere on Earth. When this happens,
communications with the satellite get disrupted.
Can anyone test it for me, for example by comparing its results with
those from any other program that may be around?
Thanks.
dow
------------------------------------------------
' SATOUTS.BAS
' David Williams, 2003
' This version dated 2003 Mar 16
' david.williams{at}ablelink.org
CLS
PRINT "Calculates dates and times when geostationary satellites"
PRINT "pass in front of sun, interfering with transmissions."
PRINT
R = 6.615 ' Radius of geosynchronous orbit in units of earth radius
PI = 4 * ATN(1)
CF1 = PI / 180
CF2 = PI / 182.62
PRINT "Input latitude and longitudes in degrees."
PRINT "Use negative numbers for angles in"
PRINT "opposite directions to those shown."
PRINT
INPUT "Your latitude (deg. north)"; LT
LT = CF1 * LT
INPUT "Your longitude (deg. west)"; LG
LG = CF1 * LG
INPUT "Satellite's longitude (deg. west)"; LS
LS = CF1 * LS
INPUT "Time zone offset (+/- hours from G.M.T.)"; TZ
TZ = 60 * TZ
LD = LS - LG ' longitude difference
' coordinate differences
X = R * SIN(LD)
Y = -SIN(LT)
Z = R * COS(LD) - COS(LT)
' calculate apparent declination
AD = ATN(Y / SQR(X * X + Z * Z))
' calculate apparent longitude
IF Z = 0 THEN
AG = SGN(X) * PI / 2
ELSE
AG = ATN(X / Z)
IF Z < 0 THEN AG = AG + PI
END IF
PRINT
PRINT "Nominal outage dates and times:"
' find dates (days after New Year) when sun is at same declination
FOR J = 1 TO 2
U = 170
IF J = 1 THEN L = 0 ELSE L = 340
FOR K = 1 TO 8
M = (U + L) / 2
A = CF2 * (M + 11) + .033 * SIN(CF2 * (M - 2))
S = -.3987 * COS(A)
S = ATN(S / SQR(1 - S * S))
IF S > AD THEN U = M ELSE L = M
NEXT
D = CINT((U + L) / 2)
' convert date to month and day
E = D
M = 0
RESTORE
DO
READ L
IF D < L THEN EXIT DO
D = D - L
M = M + 1
LOOP
DATA 31,28,31,30,31,30,31,31,30,31,30,31
D = D + 1
M$ = MID$("JanFebMarAprMayJunJulAugSepOctNovDec", 3 * M + 1, 3)
PRINT M$; D,
' calculate equation of time
Q = E + 2 * SIN((E - 2) * CF2)
Z = 9.7 * SIN(2 * (Q + 11) * CF2) + 7.9 * SIN((Q - 2) * CF2)
' calculate outage time
T = CINT(720 + 4 * (AG + LG) / CF1 + TZ + Z)
T = T - 1440 * INT(T / 1440)
H = T \ 60
M = T MOD 60
PRINT H; "hrs,"; M; "mins"
NEXT
PRINT
PRINT "Outages occur for a few days before and after nominal dates,"
PRINT "and for a few minutes before and after nominal times."
END
--------------------------------------------------
--- Platinum Xpress/Win/WINServer v3.0pr5
* Origin: The Bayman BBS,Toronto, (416)698-6573 - 1:250/514 (1:250/514)SEEN-BY: 633/267 270 @PATH: 250/514 140/1 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.