REM Program to calculate the apsidal motion rate from observations REM By James Marshall (class of 1996), summer 1995, Villanova University CONST PI = 3.14159265359# CONST DEGTORAD = PI / 180 CONST RADTODEG = 180 / PI CONST DAYSPERYEAR = 365.242198781# CLS PRINT "Observed Apsidal Motion Calculator" PRINT "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" PRINT PRINT "This program calculates an apsidal motion rate based on observations" PRINT "and not theory. You will be prompted to input the necessary values." PRINT INPUT "Name of star: ", starname$ PRINT INPUT " Eccentricty of the orbit, e: ", e# INPUT " Longitude of periastron, w (deg): ", wdeg# INPUT " Period of primary eclipse, P_p (day): ", pp# INPUT " Period of secondary eclipse, P_s (day): ", ps# PRINT wrad# = wdeg# * DEGTORAD pbar# = (pp# + ps#) / 2 term1# = pbar# / (pp# - ps#) term2# = (1 - (e# ^ 2)) ^ (3 / 2) term3# = 4 * e# * SIN(wrad#) term4# = (1 - ((e# ^ 2) * ((SIN(wrad#)) ^ 2))) ^ 2 Uday# = ((term2# * term3# * pbar#) / term4#) * term1# Uaps# = Uday# / DAYSPERYEAR omegadot# = (360 / Uaps#) * 100 PRINT "U_aps (years) = "; Uaps# PRINT "omega dot = "; omegadot#; " deg / 100 yr" PRINT INPUT "Would you like to save these values to a file (Y/N)"; ans$ IF (ans$ <> "y" AND ans$ <> "Y") THEN GOTO skipit PRINT "Full path and name of file to save to (.cal extension automatic): " INPUT " "; filename$ OPEN filename$ + ".cal" FOR OUTPUT AS #1 PRINT #1, "Observed apsidal motion rate calculation for "; starname$ PRINT #1, "" PRINT #1, " Eccentricty of the orbit, e: ", e# PRINT #1, " Longitude of periastron, w (deg): ", wdeg# PRINT #1, " Period of primary eclipse, P_p (day): ", pp# PRINT #1, " Period of secondary eclipse, P_s (day): ", ps# PRINT #1, "" PRINT #1, "U_aps (years) = "; Uaps# PRINT #1, "omega dot = "; omegadot#; " deg / 100 yr" CLOSE #1 skipit: PRINT "Have a nice day! :)" END