10 'O-GEM.BAS R.S. FRITZIUS 05/05/1990 revised 5 June 2001 'This program is a combination of TRIBODY.BAS and SEKERIN.BAS CLS : PRINT : PRINT 'This "Low-Tec logo will look all right in Quick Basic. PRINT " ΙΝΝΝΝΝΝΝΝΝ» " PRINT " ΘΝΝΝ» ΙΝΝΝΌ " PRINT " ΙΝ» ΙΝΝΝΝΝΝΝΝΝ» ΙΝ» ΙΝ» Ί Ί ΙΝΝΝΝΝΝΝΝ» ΙΝΝΝΝΝΝΝΝ» " PRINT " Ί Ί Ί ΙΝΝΝΝΝ» Ί Ί Ί Ί Ί Ί Ί Ί ΙΝΝΝΝ» Ί Ί ΙΝΝΝΝΝΝΌ " PRINT " Ί Ί Ί Ί Ί Ί Ί Ί ΙΝ» Ί Ί ΙΝΝ» Ί Ί Ί ΘΝΝΝΝΌ Ί Ί Ί " PRINT " Ί Ί Ί Ί Ί Ί Ί Ί Ί Ί Ί Ί ΘΝΝΌ Ί Ί Ί ΙΝΝΝΝΝΝΌ Ί Ί " PRINT " Ί Ί Ί ΘΝΝΝΝΝΌ Ί Ί ΘΝΌ ΘΝΌ Ί Ί Ί Ί ΘΝΝΝΝΝΝ» Ί ΘΝΝΝΝΝΝ» " PRINT " Ί Ί ΘΝΝΝΝΝΝΝΝΝΌ ΘΝΝΝΝΝΝΝΝΝΌ ΘΝΌ ΘΝΝΝΝΝΝΝΝΌ ΘΝΝΝΝΝΝΝΝΌ " PRINT " Ί ΘΝΝΝΝΝΝ» TM " PRINT " ΘΝΝΝΝΝΝΝΝΌ Scientific Simulations Software" PRINT PRINT " Omega Geminorum" DEFINT I-K, N DX = 0 ' Delta X between pairs of bodies DY = 0 ' Delta Y between pairs of bodies I = 0 ' General Counter J = 0 ' General Counter K = 0 ' General Counter C1 = 20 C2 = -9 DT = .5' Time Increment in seconds for position updates ICOUNT = 0' Counter used for dashed line center of mass plot DIM X(3), Y(3)' X and Y coordinate arrays for bodies DIM M(3) ' Mass of bodies array DIM R(3, 3)' temporary DIM DF(3) DIM VX(3), VY(3) ' X and Y velocity arrays for bodies IDELAY = 10' Dummy value IDELMIN = 2'Delay Minimum IDELMAX = 25000'Delay Maximum IL = 21' Input Line 'MS = 1.968E+30' Solar Mass in Kg (Not used at present.) 'G = 6.67E-11 ' Grav Constant nt-m^2/kg^2 (A arbitrary value is used.) F10 = 0 'Additions for Omega Geminorum simulation DIM YO(3) ' Scaled Y position array ' YO(i) = Y(i)*RS DIM VYO(3) ' Scaled Y velocity array ' VYO(i)=VY(i)*VE NMB=1000 DIM MAG(NMB) ' Light curve magitude bins C = 3E+08 ' Speed of light in meters/sec RS = 6.95E+08 ' Solar Radius in meters LY = 9.4605E+15 ' Light Year in meters NSOR#=3.4 * RS ' Neutron Star #1 orbit radius VO = 235700! ' Mean Orb spd of object at 3.4 solar radii (meters/sec) PO = 62960! ' Orbit period secs for object at 3.4 solar radii ' this is 17.49 hours ' Period of Omega Gem is .7282 days or 17.48 hours ' Neutron star #1 completes one orbit in 334 steps ET# = 0 ' Emission time TT# = 0 ' Travel Time to Observer AT# = 0 ' Arrival Time at Observer DTO#=PO/334 ' Delta T (real time) in seconds L = 1.202E+16 ' Overtaking Distance T*c^2/v (1.270LY) ObsDist=L/15 ' Observer Distance in meters (0.08LY) DTau = 1 ' Delta Tau GOSUB 3200 ' Measure computer speed to Calculate operational delay ESC$ = CHR$(27)' Escape Key 20 CLS FOR I = 1 TO 200' Pause before printing next screen FOR J = 1 TO IDELAY: NEXT J NEXT I PRINT : PRINT : PRINT PRINT " NEWTONIAN THREE-BODY MODELING" PRINT PRINT " (O-GEM)" PRINT PRINT " Copyright (c) 2001 Robert S. Fritzius" PRINT PRINT " Portions of run-time module Copyrighted by Microsoft, 1982-1987" PRINT PRINT " Manufactured by" PRINT PRINT " Low-Tec 305 Hillside Drive Starkville, MS 39759" PRINT PRINT PRINT PRINT PRINT LOCATE 23, 18: PRINT "S=Simulations I=Info ESC=Exit program" 80 Z$ = INKEY$: IF Z$ = "" THEN 80 IF Z$ = "S" OR Z$ = "s" THEN 100 IF Z$ = "I" OR Z$ = "i" THEN GOSUB 5000: GOTO 20 IF Z$ = ESC$ THEN CLS : SCREEN 0: END GOTO 80 100 'Define Variables (most values will be defined in the program) I1 = 0 ' Counter in operational delay calculation routine I2 = 0 ' Counter in operational delay calculation routine Ai = 0 ' Acceleration of Ith body KC12 = 0 ' Center of Mass (bodies 1 & 2) plot ON/OFF 1=ON 0=OFF M12 = 0 ' Mass of bodies 1 and 2 combined MALL = 0 ' Mass of all bodies combined NB = 3 ' Number of Bodies NP = 0 ' Number of Bodies to plot with respect to C.M. 1,2 230 R = 0 ' Distance between pairs of bodies 240 RR = 0 ' Distance Squared - Body to Body in arbitrary units R1 = 0 ' Radius body 1 R2 = 0 ' Radius body 2 R3 = 0 ' Radius body 3 250 S1 = 0 ' Scale Factor 1 (General X,Y) set below 255 S2 = 1 ' Scale Factor 2 (for center of mass plot) 260 SF = 0 ' This will be the adjustable Scale Factor 265 SN = 0 ' Senario Number 515 TB = 20 ' Tab Setting on Menu Screen 270 TITLE1$ = "" ' Scenario Title-1" 275 TITLE2$ = "" ' Scenario Title-2 277 COM12$ = "" ' Center of Gravity bodies 1 & 2 label 280 IXREF = 250 ' X Origin X/Y Plot Screen Laboratory coordinates 290 JYREF = 80 ' Y Origin X/Y Plot screen Laboratory coordinates 300 IXQ = 280' X Origin X/Y plot for motion about c.m. 1,2 310 JYQ = 80' Y Origin X/Y plot for motion about c.m. 1,2 320 IXS = 0 ' X on Screen (Integer) 330 JYS = 0 ' Y on Screen (Integer) 340 X12 = 0 ' X center of mass bodies 1,2 350 Y12 = 0 ' Y center of mass bodies 1,2 360 XALL = 0 ' X center of mass all bodies 370 YALL = 0 ' Y center of mass all bodies 375 ILB = 20 ' X coordinate for C.O.G. Label for bodies 1 & 2 380 RMIN = 0 ' Minimum radius of planet or star 390 ILIMIT = 30000 ' Graphics edge 410 UA$ = CHR$(0) + CHR$(72)' Up Arrow 420 DA$ = CHR$(0) + CHR$(80)' Down Arrow 430 LA$ = CHR$(0) + CHR$(75)' Left Arrow 440 RA$ = CHR$(0) + CHR$(77)' Right Arrow 445 F1$ = CHR$(0) + CHR$(59)' F1 Key 450 F2$ = CHR$(0) + CHR$(60)' F2 Key 455 F3$ = CHR$(0) + CHR$(61)' F3 Key 460 F4$ = CHR$(0) + CHR$(62)' F4 Key 465 F9$ = CHR$(0) + CHR$(67)' F9 Key 470 SP$ = CHR$(32) ' Space Bar 480 IXMAX = 680 490 JYMAX = 210 500 DIM VN(15) ' VN() array is used for changing variable parameters 'DIM IXS(3),JYS(3) 502 BL$ = " Space Bar to Stop/Start/Change " 504 BLANK$ = STRING$(78, " ") 510 CLS : SCREEN 0'-----------menu screen----------- 520 WS% = 3: SN = 0: GOTO 860' Bypass first two scenarios 'Scenarios 1 and 2 deleted 860 '--------scenario 3------------- 865 SN = 3 870 TITLE1$ = "G5 Star and 2 Neutron Stars" 880 TITLE2$ = " G5 Star NS1 NS2" 885 COM12$ = "G5 Star & 2 Neutron Stars " 890 S1 = .75: S2 = .3 905 NP = 3 910 KC12 = 1' Center of mass plot ON 912 IXEL = -3: IXER = 4 914 JYEB = -4: JYET = 4 RMIN = .1 920 'Primary ns #1 ns #2 X1 = 0: X2 = 0: X3 = 38.9994 '(38.98) Y1 = -6.25: Y2 = 1.6: Y3 = 0 M1 = 10: M2 = 1.4: M3 = 1.4 '(1.4) R1 = .1 : R2 = .0001: R3 = .00001 VX1 =-.014: VX2 = .12: VX3 = 0 VY1 = 0 : VY2 = 0: VY3 = -.0455585 '(-0.4584) G = 1.3e-2 980 REM Load initial variables into parameter changing arrays 985 VN( 1) = X1: VN( 2) = X2: VN( 3) = X3 ' X components 990 VN( 4) = Y1: VN( 5) = Y2: VN( 6) = Y3 ' Y components 1000 VN( 7) = M1: VN( 8) = M2: VN( 9) = M3 ' Masses 1010 VN(10) = VX1: VN(11) = VX2: VN(12) = VX3 ' X components of velocities 1020 VN(13) = VY1: VN(14) = VY2: VN(15) = VY3 ' Y components of velocities ' 1040 CLS : SCREEN 0 SF = S1/2 LOCATE 3, 1 1100 PRINT "Initial parameters for "; TITLE1$; ":" 1110 PRINT 1130 PRINT TITLE2$ 1140 PRINT 1150 PRINT USING "Initial X (a) ###.### (b) ###.### (c) ###.#### "; VN(1); VN(2); VN(3) PRINT 1170 PRINT USING "Initial Y (d) ###.### (e) ###.### (f) ###.#### "; VN(4); VN(5); VN(6) PRINT 1190 PRINT USING "Mass (g) ###.### (h) ###.### (i) ###.### "; VN(7); VN(8); VN(9) PRINT 1210 PRINT USING "Initial VX (j) ###.### (k) ###.### (l) ##.###### "; VN(10); VN(11); VN(12) PRINT 1230 PRINT USING "Initial VY (m) ###.### (n) ###.### (o) ##.###### "; VN(13); VN(14); VN(15) PRINT PRINT USING "G = #.#####";G; PRINT:PRINT 1252 PRINT "ESC Return to main menu (q) Scenario Info (r) Restore Demo Settings "; 1280 LOCATE IL, 1 PRINT "Which option or variable to change "; 1285 WI$ = INKEY$: IF WI$ = "" THEN 1285 IF WI$ = ESC$ THEN 20 '510 WI% = ASC(WI$) IF WI% = 13 THEN GOTO 1430' ENTER was pressed - run simulation IF WI% < 64 OR WI% > 122 THEN 1285' Outside range of acceptible keystrokes IF WI% > 96 AND WI% < 123 THEN WI% = WI% - 32'Make keystroke upper case WI% = WI% - 64' Downshift 1300 IF WI% > 18 THEN GOTO 100 IF WI% = 16 THEN 1040' Don't let Grav Const be a selectable item 1345 IF WI% = 17 THEN GOSUB 8000: GOTO 1040' (q) Info then to the top at return IF WI% = 18 THEN 860'(r) Restore initial conditions LCWI$ = CHR$(WI% + 96)'for screen display of selected item 1355 LOCATE IL, 1: PRINT BLANK$; LOCATE IL, 1: PRINT " New value for ("; LCWI$; ") "; 1375 INPUT VN$: IF VN$ = "" THEN 1280 1380 VN = VAL(VN$) LOCATE IL, 1: PRINT BLANK$; IF WI% > 0 AND WI% < 16 THEN VN(WI%) = VN: GOTO 1040 1390 'IF WI%=16 AND VN>0 AND VN<=1 THEN G=VN:GOTO 1040 1410 GOTO 1040 1420 : 1430 CLS : SCREEN 2 1440 REM Load variables into operational arrays 1445 FOR I = 1 TO 3 1447 DF(I) = 0' Display Drift Factor 1450 X(I) = VN(I + 0) 1460 Y(I) = VN(I + 3) 1470 M(I) = VN(I + 6) 1480 VX(I) = VN(I + 9) 1490 VY(I) = VN(I + 12) 1495 NEXT I 1500 : 1510 M12 = M(1) + M(2) ' Combined Mass of bodies 1 & 2 1550 MALL = M(1) + M(2) + M(3)' Combined Mass of all three bodies 1560 : 1570 CLS : PRINT " RITZIAN THREE BODY LIGHT CURVE GENERATOR" 1582 ILB = 15 - LEN(COM12$) / 2 LOCATE 3,33:PRINT "Observer"; 1585 'LOCATE 21,ILB:PRINT COM12$; 1587 LOCATE 7,1:PRINT "All three bodies"; LOCATE 8,1:PRINT "are plotted with"; LOCATE 9,1:PRINT "respect to the"; LOCATE 10,1:PRINT "center of mass"; LOCATE 11,1:PRINT "for the Primary"; LOCATE 12,1:PRINT "and 1st neutron"; LOCATE 13,1:PRINT "star."; LOCATE 23, 20: PRINT "Use Space Bar to Start/Stop the Action."; 1600 LOCATE 24, 1 1610 PRINT "ESC=New Run F1=Slower F2=Faster F3=Shrink F4=Expand F9=Erase Arrows=Move Origin"; PIC = 0 'Present Iterative Count ET# = 0 'Emission Times, Omega Geminorum objects 1670 REM Calculate new X and Y velocities - Loop start point FOR I=1 TO NMB MAG(I)=0 NEXT I 1675 ICOUNT = ICOUNT + 1: IF ICOUNT = 40 THEN ICOUNT = 0'see line 1935 PIC=PIC+1 'LOCATE 8,1:PRINT " "; 'LOCATE 8,1:PRINT PIC; ET# = ET# + DTO#' Emisson Time For Omega Gem scenario FOR I = 1 TO NB'calculate new velocites for Ith mass FOR J = 1 TO NB'based on summation of grav forces of J masses IF I = J THEN 1780' No self actions DX = X(I) - X(J): DY = Y(I) - Y(J) RR = DX ^ 2 + DY ^ 2 Ai = G*M(J) / RR ' (G*M(I)*M(J)/RR) * 1/M(I) R = SQR(RR) IF R < RMIN THEN 1780' Drift through IF I<>2 AND J<>3 THEN 1750 'LOCATE 9,1:PRINT " "; 'LOCATE 9,1:PRINT "R = ";R; 1750 R(I, J) = R VX(I) = VX(I) - Ai * (DX/R) ' DX/R is cosine theta VY(I) = VY(I) - Ai * (DY/R) ' DY/R is sine theta 1780 NEXT J NEXT I 1800 ' 1810 REM Calculate and plot New X and Y coordinates for all Bodies 1820 FOR I = 1 TO NB X(I) = X(I) + VX(I) Y(I) = Y(I) + VY(I) 'Omega Gem calculations (Y coords & velocities only) VYO(I) = (VY(I)/VX2) * VO 'Y component of Orbit Velocity YO(I) = Y(I)*NSOR#/Y2 'Y component of Orbit Position TT# = (ObsDist - YO(I)) / (C + VYO(I))'Travel Time to observer AT# = ET# + TT# 'Arrival Time BIN = INT((AT# - 1E+07) / 1000! + 7330) IF BIN<=NMB THEN GOTO 1830 LOCATE 18,1:PRINT "Light curve bins are full." GOTO 2077 1830 'LOCATE 7,1:PRINT " "; 'LOCATE 7,1:PRINT "BIN ";BIN; MAG(BIN) = MAG(BIN) + 1 ON I GOTO 1841, 1842, 1843 1841 'LOCATE 4, 5: PRINT " "; 'LOCATE 4, 5: PRINT AT#; GOSUB 2500 ' Light curve update GOTO 1850 1842 'LOCATE 4, 30: PRINT " "; 'LOCATE 4, 30: PRINT AT#; GOSUB 2500 ' Light curve update GOTO 1850 1843 'LOCATE 4, 55: PRINT " "; 'LOCATE 4, 55: PRINT AT#; GOSUB 2500 ' Light curve update 1850 'GOSUB 2200 ' Plot IF ABS(IXS) > ILIMIT THEN 2700 IF ABS(JYS) > ILIMIT THEN 2700 1860 NEXT I 1880 REM Calculate and plot Center of mass for Bodies 1 and 2 (c.m. 1,2) 1890 X12 = (M(1) * X(1) + M(2) * X(2)) / M12 1900 Y12 = (M(1) * Y(1) + M(2) * Y(2)) / M12 1910 'IF KC12 = 1 THEN GOSUB 2300' Plot center of mass for bodies 1 & 2 1920 : 1930 REM Calculate and plot Center of mass for all bodies 1935 IF ICOUNT > 20 THEN 1980' Creates dashed line for C.O.M. all XALL = (M(1) * X(1) + M(2) * X(2) + M(3) * X(3)) / MALL YALL = (M(1) * Y(1) + M(2) * Y(2) + M(3) * Y(3)) / MALL 'IF KC12 = 1 THEN GOSUB 2350' Plot center of mass for all bodies 1970 ' 1980 REM Calc and plot positions of all bodies with respect c.m. 1-2 1990 FOR I = 1 TO 3 2000 XC = X(I) - X12 2010 YC = Y(I) - Y12 2030 GOSUB 2400 ' Plot positions 2040 NEXT I GOSUB 2600 ' Print radii 2044 'Crank in some processing delay to keep program 'from going too fast FOR JJ = 1 TO 25 FOR J = 1 TO IDELAY: NEXT J NEXT JJ 'LOCATE 2, 24: PRINT USING "X(3)=#####.## Y(3)=#####.##"; X(3); Y(3); LOCATE 17,1:PRINT " Light Curve"; LOCATE 18,1:PRINT "(Initially Cepheid-like.)"; IF PIC>1 THEN 2070 2050 Z$=INKEY$:IF Z$="" THEN 2050 IF Z$=SP$ THEN GOTO 1675 IF Z$=ESC$ THEN GOTO 1040 2070 Z$ = INKEY$: IF Z$ = "" THEN GOTO 1675 IF Z$ = ESC$ THEN GOTO 1040'New Run IF Z$ <> SP$ THEN GOTO 2080 2077 Z$ = INKEY$: IF Z$ = "" THEN 2077'Pause for space bar IF Z$ = ESC$ THEN 1040'New Run IF Z$=SP$ THEN GOTO 1675 2078 GOTO 2077 2080 IF Z$ = UA$ THEN JYREF = JYREF - 30: GOTO 1670 2090 IF Z$ = DA$ THEN JYREF = JYREF + 30: GOTO 1670 2100 IF Z$ = LA$ THEN IXREF = IXREF - 100: GOTO 1670 2110 IF Z$ = RA$ THEN IXREF = IXREF + 100: GOTO 1670 2140 IF Z$ = F1$ AND IDELAY < .8 * IDELMAX THEN GOSUB 3500: GOTO 1670' Slower 2150 IF Z$ = F2$ AND IDELAY > 1.25 * IDELMIN THEN GOSUB 3600: GOTO 1670' Faster 2120 IF Z$ = F3$ THEN SF = SF / 2: GOTO 1670' Shrink 2130 IF Z$ = F4$ THEN SF = SF * 2: GOTO 1670' Expand 2155 IF Z$ = F9$ THEN GOTO 1570 ' Erase & continue ' 2180 GOTO 1670 ' 2185 '----------------- end of loop --------------------------- ' 2200 REM plot X,Y on screen in graphics format DF(I) = DF(I) + 0 'drift increment IXS = INT(C1 * SF * X(I) + IXREF + DF(I)) JYS = INT(C2 * SF * Y(I) + JYREF) IF IXS < 0 OR JYS < 0 THEN 2260 IF IXS > IXMAX OR JYS > JYMAX THEN 2260 DRAW "BM" + STR$(IXS) + "," + STR$(JYS) DRAW " M" + STR$(IXS) + "," + STR$(JYS) 2260 RETURN ' 2300 REM plot Center of mass for bodies 1 and 2 IXS = INT(C1 * SF * X12 + IXREF) JYS = INT(C2 * SF * Y12 + JYREF) IF IXS < 0 OR JYS < 0 THEN 2340 IF IXS > IXMAX OR JYS > JYMAX THEN 2340 DRAW "BM" + STR$(IXS) + "," + STR$(JYS) DRAW "M" + STR$(IXS) + "," + STR$(JYS) 2340 RETURN ' 2350 REM plot Center of mass for all bodies IXS = INT(C1 * SF * XALL + IXREF) JYS = INT(C2 * SF * YALL + JYREF) IF IXS < 0 OR JYS < 0 THEN 2390 IF IXS > IXMAX OR JYS > JYMAX THEN 2390 DRAW "BM" + STR$(IXS) + "," + STR$(JYS) DRAW "M" + STR$(IXS) + "," + STR$(JYS) 2390 RETURN ' 2400 REM plot bodies with respect center of mass DF(I) = DF(I) + .01 'drift increment IXS = INT(C1 * S2 * XC + IXQ+DF(I)) JYS = INT(C2 * S2 * YC + JYQ) IF IXS < 0 OR JYS < 0 THEN 2470 IF IXS > IXMAX OR JYS > JYMAX THEN 2470 DRAW "BM" + STR$(IXS) + "," + STR$(JYS) DRAW "M" + STR$(IXS) + "," + STR$(JYS) 2470 RETURN ' 2500 'Plot magnitude bins IXS = INT(BIN) JYS = INT(170 - MAG(BIN)) IF IXS < 0 OR JYS < 0 THEN 2570 IF IXS > IXMAX OR JYS > JYMAX THEN 2570 DRAW "BM" + STR$(IXS) + "," + STR$(JYS) DRAW "M" + STR$(IXS) + "," + STR$(JYS) 2570 RETURN 2600 REM Print values of radii IF SN <> 3 THEN 2620 IF R(2, 3) < .0001 THEN 2620 'FREQ=100+1000/R(2,3) 'SOUND FREQ,1 2620 'LOCATE 3,55:PRINT USING "###.### ";R(1,1);R(1,2);R(1,3); 'LOCATE 4,55:PRINT USING "###.### ";R(2,1);R(2,2);R(2,3); 'LOCATE 5,55:PRINT USING "###.### ";R(3,1);R(3,2);R(3,3); 'LOCATE 6,55:PRINT USING "###,### ";IXS(1);IXS(2);IXS(3); 'LOCATE 7,55:PRINT USING "###,### ";JYS(1);JYS(2);JYS(3); 2660 RETURN ' 2700 'Print overflow message LOCATE 2, 10 PRINT "Math overflow is approaching. Press ESC to start new run."; 2710 Z$ = INKEY$: IF Z$ = "" THEN 2710 GOTO 1040 ' 3200 'Calculating processing delay I1 = VAL(RIGHT$(TIME$, 2)) J = 0: K = 0 X(1) = 10: X(2) = 5: Y(1) = 20: Y(2) = 15 3230 FOR I = 1 TO 400' dummy math processing DX = X(1) - X(2): DY = Y(1) - Y(2) R = SQR(DX ^ 2 + DY ^ 2) NEXT I J = J + 1 I2 = VAL(RIGHT$(TIME$, 2)) IF I2 < I1 THEN I2 = I2 + 60'I2 has passed the 60 sec mark IF I2 = I1 + 2 AND K = 0 THEN GOSUB 3400'Print message IF I2 < I1 + 5 THEN GOTO 3230 3280 IDELAY = 10 * J + 1 IF IDELAY < IDELMIN THEN IDELAY = IDELMIN IF IDELAY > IDELMAX THEN IDELAY = IDELMAX 3310 RETURN 3320 ' 3400 'Print delayed message on screen COLOR 25 ' light blue, flashing LOCATE 17, 23: PRINT "Measuring computer operational speed" COLOR 7 K = 1 RETURN 3500 IDELAY = INT(1.25 * IDELAY)'slow down IF IDELAY > IDELMAX THEN IDELAY = IDELMAX 3520 'SOUND 1000-INT(40*LOG(IDELAY)),1 3530 RETURN 3590 ' 3600 IDELAY = INT(.8 * IDELAY)' Speed up IF IDELAY < IDELMIN THEN IDELAY = IDELMIN 3620 'SOUND 1000-INT(40*LOG(IDELAY)),1 3630 RETURN 5000 ' Info section 5010 CLS : PRINT : PRINT 5030 PRINT TAB(30); "Information Section" 5040 PRINT 5050 PRINT "Tribody models the gravitational interactions and plots the positions" 5060 PRINT "of three bodies which are traveling in a plane. Initial conditions" 5070 PRINT "are pre-programmed, but they may be changed between runs." 5080 PRINT 5090 PRINT "After you have chosen which simulation to run, you will be given a screen" 5100 PRINT "that shows the masses, starting positions, and velocities for each of the" 5110 PRINT "bodies." 5120 PRINT 5130 PRINT "You may select the information option for that scenario, option (q), to get a" 5140 PRINT "description of what the simulation does." 5150 PRINT 5160 PRINT "During each simulation you may use the SPACE BAR to stop/start the action." 5300 LOCATE 23, 27: PRINT "ESC = Return to Main Menu" 5320 Z$ = INKEY$: IF Z$ = "" THEN 5320 5330 IF Z$ = ESC$ THEN RETURN 5350 5360 : 8000 CLS : PRINT PRINT " G5 STAR AND TWO NEUTRON STARS" PRINT PRINT " In this simulation a G5 Star (body-1) is being orbited by a neutron star" PRINT "(body 2) which is travelng in a nearly circular orbit and by a second neutron" PRINT "star (body 3) traveling in a larger, more eliptical, path." PRINT PRINT " The initial position and velocity of the second neutron star has been" PRINT "painstakingly chosen such that when it reaches perihelion with respect to the " PRINT "G5 star the two neutron stars are close enough that they begin orbiting each " PRINT "another in a new common orbit around the G5 star." PRINT PRINT "(The positon/velocity selection process is not unlike searching for energy" PRINT "eigenvalues in quantum mechanics.)" PRINT PRINT "In the bottom part of the run display a real time light curve is generated" PRINT "that follows the action using Ritz's c+v relativity. The idea is to see" PRINT "under what conditions the direct rapid orbital interactions of the neutron " PRINT "stars might produce a light curve similar to that for the peculiar Gamma-ray" PRINT "burst KONUS 790731." PRINT PRINT " During the run use the SPACE BAR start or stop the action." PRINT " Press any key to return" 8170 Z$ = INKEY$: IF Z$ = "" THEN 8170 8180 GOTO 1040 9000 '-----------return from info screen routine------- 9180 LOCATE 23, 18: PRINT "S=Simulation M=Menu ESC=Exit program"; 9200 Z$ = INKEY$: IF Z$ = "" THEN 9200 9210 IF Z$ = "S" OR Z$ = "s" THEN RETURN 9215 IF Z$ = "M" OR Z$ = "m" THEN MENU = 1: RETURN 9220 IF Z$ = ESC$ THEN GOTO 9900 9230 GOTO 9200 9290 : 9300 '-----------goto next screen or previous screen----------------- 9310 LOCATE 23, 18 PRINT "P=Previous Screen N=Next Screen S=Simulation " 9320 Z$ = INKEY$: IF Z$ = "" THEN 9320 9330 IF Z$ = "P" OR Z$ = "p" THEN code = 1: RETURN 9340 IF Z$ = "N" OR Z$ = "n" THEN code = 2: RETURN 9350 IF Z$ = "S" OR Z$ = "s" THEN code = 3: RETURN 9370 GOTO 9320 9890 : 9900 CLS : RETURN 10000 IF ERR <> 5 THEN PRINT "Error code ="; ERR: GOTO 10090 10090 LOCATE 23, 20 PRINT " Press any key to exit program."; 10095 Z$ = INKEY$: IF Z$ = "" THEN 10095 END