Listing of file='ROKSIM.BAS;01' on disk='vmedia/taylor-sideA-sector.ccvf'
5 PLOT 12,15 10 DIM A(200),A0(200),A1(7),A2(7),A3(6),A4(6) 15 GOSUB 3000 16 INPUT "WOULD YOU LIKE SOME INSTRUCTIONS? ";CC$ 17 IF CC$= "YES"OR CC$= "Y"THEN GOSUB 4000 18 PLOT 15 20 INPUT "DESIGN AND ORBIT A SPACE SHIP. HOW MANY STAGES (1-6) ";A5 30 PRINT 40 PRINT "VERIFICATION OF ";A5;" STAGES." 50 A6= A5+ 1 55 PRINT 60 PRINT "ENTER ITERATION TIME IS SEC., AND ORBIT HEIGHT IN MI.,.1 SEC. " 70 PRINT "IS OK AND .01 BETTER, BUT WITH MORE CPU TIME." 75 PRINT 80 INPUT "TIME,HEIGHT ";A7,A8 85 PRINT 90 PRINT "VARIFICATION , ITERATION TIME ";A7;" ORBIT HEIGHT ";A8 95 PRINT 100 INPUT "ENTER PAYLOAD WEIGHT IN POUNDS. ";A2(A6) 120 A1(A6)= 0.0 125 PRINT 130 PRINT "VERIFICATION, PAYLOAD WEIGHT, ";A2(A6) 135 PRINT 140 FOR A9= 1TO A5 150 B= A6- A9 160 B0= B+ 1 170 PRINT "ENTER STAGE ";B;" FUEL AND HULL WEIGHTS IN LBS." 180 PRINT :INPUT "FUEL, WEIGHT ";A1(B),A2(B) 185 PRINT 190 PRINT "STAGE ";B;" FUEL ";A1(B);" LBS., HULL ";A2(B);" LBS. " 200 A2(B)= A2(B)+ A2(B0)+ A1(B0) 210 B1= A2(B)+ A1(B) 215 PRINT 220 PRINT "ENTER STAGE ";B;" THRUST AT LEAST ";B1;" .LBS. " 230 PRINT :INPUT "THRUST ";A3(B) 235 PRINT 240 PRINT "STAGE ";B;" THRUST, "A3(B);" LBS. " 250 PRINT :PRINT "ENTER SPECIFIC IMPULSE OF STAGE ";B;" FUEL/OXIDIZER. THIS IS " 260 PRINT "THE THRUST-TO-BURN RATE RATIO. " 270 PRINT "FOR GASOLINE = 250 , PEROXIDE = 300 , LIQUID HYDROGEN = 500." 280 PRINT :INPUT "SPECIFIC IMPULSE ";A4(B) 285 PRINT 290 PRINT "VERIFICATION, STAGE ";B;" SPECIFIC IMPULSE ";A4(B) 295 PRINT 300 NEXT A9 310 B2= 10 320 B3= B2* A7 330 B4= 360 340 B5= B3/ 100.0 350 B6= 5280* .3048 360 B7= 6.6E- 11* 5.983E24 370 B8= ATN (1)/ 45 380 B9= 90 390 C= 1 400 C0= SQR (B7/ 9.80665) 410 C1= C0 420 C2= SQR (B7/ (C0+ B6* A8))/ .3048 430 C3= 0 440 C4= 0 450 C5= 0 460 C6= 0 470 C7= 0 480 C8= 0 490 C9= 0 500 D= 0 510 D0= 0 520 D1= 0 530 D2= 0 540 D3= 0 550 PRINT "THE SHIP CAN SWIVEL ";B2;" DEG/SEC. EARTH'S GRAVITY IS 32.174" 560 PRINT "FT/SEC/SEC. FORWARD VELOCITY NEEDED FOR ORBIT ";C2;" FT/SEC. 580 D= D+ 1 590 D4= A2(D)/ 2.2046 600 D5= A3(D)/ A4(D)/ 2.2046 610 D6= A1(D)/ 2.2046 620 D7= D6 630 D8= A3(D)/ 2.2046* 9.80665 635 PRINT 640 PRINT "IGNITION OF STAGE ";D 645 REM IN PROGRAM BUT NOT USED? INPUT"ENTER THE STAGE NUMBER ";X1 647 PRINT 650 GOTO 1090 660 IF G= 0THEN D9= 0:E= 0:E0= 100:A7= 1:PRINT "WORKING":GOTO 700 666 PRINT "ENTER THROTTLE SETTING IN %, FROM 0 TO 100, THRUST ANGLE IN " 670 PRINT "DEG. FROM - ";B4;" TO ";B4" AND BURN TIME IN SECONDS." 680 PRINT 690 INPUT "%,DEG,SEC ";D9,E,E0 700 D9= ABS (D9/ 100) 710 E1= D9* D8 720 E2= D9* D5* A7 730 E3= E2/ 100 740 E4= E0- (A7/ 100) 750 E5= C5* C1 760 E6= 0 770 IF E0= 0THEN 1080 780 IF C1< C0THEN 1080 790 E6= E6+ A7 800 E7= D7- E2 810 E8= E1/ (D4+ (D7+ E7)/ 2) 820 IF E7> = E3THEN 850 830 E7= 0 840 E8= 0 850 IF ABS (E- B9)< B5THEN 930 860 IF E< B9THEN 890 870 B9= B9+ B3 880 GOTO 900 890 B9= B9- B3 900 E9= B9* B8 910 C4= COS (E9) 920 C= SIN (E9) 930 F= E8* C4 940 F0= E8* C 950 F1= C5+ F* A7 960 C6= (C5+ F1)/ 2 970 C7= C7+ C6* A7 980 F2= F0+ C6^ 2/ C1- B7/ C1^ 2 990 F3= C8+ F2* A7 1000 F4= C1+ (C8+ F3)/ 2* A7 1010 IF D9< > 0THEN 1030 1020 F1= E5/ F4 1030 D7= E7 1040 C5= F1 1050 C8= F3 1060 C1= F4 1070 IF E6< E4THEN 770 1080 C3= C3+ E6 1089 REM GOTO FROM 650 1090 D2= D2+ 1 1100 A(D2)= (C1- C0)/ .3048 1110 IF C9> = A(D2)THEN 1130 1120 C9= A(D2) 1130 IF A(D2)> = 0.0THEN 1150 1140 A(D2)= 0.0 1150 IF A(D2)< 400000THEN 1170 1160 D3= D3+ 1 1170 F5= A(D2)/ 5380 1180 F6= C8/ .3048 1190 F7= F6* 15/ 22 1200 F8= C5/ .3048 1210 F9= F8* 15/ 22 1220 A0(D2)= C7/ B6 1230 G= 100* D7/ D6 1240 G0= D7/ D5 1250 G1= B7/ C1^ 2- C6^ 2/ C1 1260 G2= D8/ (D4+ D7)/ .3048 1270 G3= G2* 15/ 22 1280 G4= G2- (G1/ .3048) 1290 G5= G4* 15/ 22 1300 G6= G1/ .3048/ G2 1310 G7= 100* G6 1320 G8= 90 1330 IF G6> = 1THEN 1350 1340 G8= ATN (G6/ SQR (1- G6^ 2))/ B8 1350 G9= SQR (B7/ C1)/ .3048 1360 H= 100* F8/ C2 1370 H0= 100* A(D2)/ (A8* 5280) 1380 H1= 100* F8/ G9 1390 H2= (C2- F8)/ G2 1400 H3= (G9- F8)/ G2 1410 IF F6= 0THEN 1440 1420 H4= (A8* 5280- A(D2))/ F6 1425 PLOT 12 1430 IF H4< = 9999.99THEN 1460 1440 H4= 9999.99 1450 REM -TIMES OVER 9999.99 SET TO 9999.99 TO NOT EXCEED DISPLAY. 1460 IF D3< > 1THEN 1480 1470 PRINT "400K FT. ACHIEVED, YOU ARE IN VACUUM.":PRINT 1480 PRINT "FLIGHT TIME","FUEL LEFT","AT FULL THROT.","SHIP ANGLE" 1490 PRINT C3;" SEC"TAB( 19)G;"%"TAB( 31)G0;" SEC"TAB( 49)B9;" DEG" 1500 PRINT " " 1510 PRINT "ALTITUDE","ASSCENT RATE","FORWARD V.","RANGE" 1520 PRINT A(D2);" FT"TAB( 16)F6;" FT/SEC"TAB( 31)F8;" FT/SEC"TAB( 47)A0(D2);" MI." 1530 PRINT F5;" MI."TAB( 16)F7;" MI/HR."TAB( 31)F9;" MI/HR." 1540 PRINT " " 1550 PRINT "MAX ACCEL","MAX VERT ACCEL","ANGLE(C.A.)","THROT(C.A.)" 1560 REM ANGLE C.A. IS CRITICAL ANGLE FOR CONST. ASCENT AT FULL THRO. 1570 REM THROT C.A. IS CRITICAL THROT. OF CONST. ASCENT AT 90 DEG 1580 PRINT G2;" FT/S/S"TAB( 16)G4;" FT/S/S"TAB( 32)"FULLTHROT."TAB( 49)"VERT.POS." 1590 PRINT G3;" MI/H/S"TAB( 16)G5;" MI/H/S"TAB( 32)G8;" DEG"TAB( 49)G7;" %" 1600 PRINT " " 1610 PRINT H;" % ORBITAL VELOCITY",H0;" % ORBITAL HEIGHT" 1620 PRINT H1;" % VELOCITY NEEDED FOR ORBIT AT CURRENT ALTITUDE." 1630 PRINT " " 1640 PRINT " "," "," TIME TO ACHIEVE:" 1645 PRINT 1650 PRINT "ORB. ALT.","ORB. VEL.","CUR. ALT. ORB. VEL." 1660 PRINT "AT CUR. RATE","AT FULL THROT.","AT FULL THROT." 1670 PRINT H4;" SEC"TAB( 17)H2;" SEC"TAB( 37)H3;" SEC" 1680 PRINT " " 1690 IF H< 100THEN 1760 1700 IF H0< 100THEN 1760 1710 D0= D0+ 1 1720 IF D0> 1THEN 1760 1730 PRINT "IN DESIRED ORBIT. TO CONTINUE ENTER 1, TO PLOT ENTER 2." 1740 INPUT H5 1750 IF H5= 2THEN 1920 1760 IF C3= 0THEN 660 1780 IF A(D2)< = 0THEN 1800 1790 GOTO 660 1800 IF A(D2)= 0THEN 1890 1810 IF D< A5THEN 580 1820 D1= D1+ 1 1830 IF D1< > 1THEN 1850 1840 PRINT "LAST STAGE SHUTDOWN. " 1850 IF D0< > 0THEN 1880 1860 IF A(D2)< = 0THEN 1880 1870 GOTO 660 1880 IF A(D2)> 0THEN 19+ .5) 1890 H6= INT (SQR (F6^ 2+ F8^ 2)+ .5) 1900 H7= INT (SQR (F7^ 2+ F9^ 2)+ .5) 1910 PRINT "YOU CRASHED AT ";H6;" FT/SEC ";H7;" MI/HR " 1920 PRINT "AFTER ";D2;" PLOT POINTS: " 1930 FOR H8= 1TO D2 1940 REM PLOT A(H8) Y-AXIS VI. A0(H8) X-AXIS, ALTITUDE VS. RANGE 1945 YZ= A(H8): XZ= A0(H8) 1946 IF YZ> YQTHEN YQ= YZ 1947 IF XZ> XQTHEN XQ= XZ 1949 NEXT H8 1950 FOR I= 1TO 2000:NEXT I:PLOT 12 1951 DX= XQ/ 60+ 1:DY= YQ/ 30+ 1 1952 FOR H8= 1TO D2 1954 PLOT 3,A0(H8)/ DX,ABS (29- A(H8)/ DY):PRINT "." 1956 NEXT H8 1960 H9= 25 1970 REM LOWER 25% CUT OFF AF ALTITUDE FOR A BLOWUP PLOT 1980 I= C9* H9/ 100* 1.0001 1990 I0= D2+ 1 2000 I0= I0- 1 2010 IF A(I0)> ITHEN 2000 2020 I1= 100* A0(I0)/ A0(D2) 2025 PLOT 8 2026 GOTO 2060:REM CUT OUT 2030 PRINT "LOWER ";H9;" % OR ";I;" MI OF MAX ALT. ATTAINED " 2040 PRINT "FIRST ";I1;" % OR ";A0(I0);" MI OF TOTAL RANGE. 2050 PRINT "WITH ";I0;" STEPS:" 2060 FOR I2= 1TO I0 2070 REM PLOT A(I2) Y-AXIS VS. A0(I2) X-AXIS, LOWER ALT. VS. RANGE 2080 NEXT I2 2090 END 3000 REM TITLE 3010 A$= "bd" 3020 FOR I= 1TO 55 3030 PLOT 3,I,10 3040 PRINT A$ 3050 NEXT I 3060 B$= " " 3070 PLOT 3,1,10 3080 PRINT B$ 3090 PLOT 3,20,10 3100 PRINT "ROCKET SIMULATION" 3110 FOR I= 11TO 29 3120 PLOT 3,55,I 3130 PRINT A$ 3135 FOR J= 1TO 100:NEXT J 3140 NEXT I 3150 PLOT 3,23,12 3160 PRINT "ADOPTED BY" 3170 PLOT 3,21,14 3180 PRINT "WILLIAM B. LEE":REM 6-18-80 3190 FOR I= 1TO 1500:NEXT I 3200 PLOT 12,14 3210 RETURN 4000 REM INSTRUCTIONS 4010 PRINT "THIS PROGRAM WORKS--HOWEVER IT DOES HAVE A BUG IN IT. YOU CAN " 4020 PRINT "ONLY USE A ONE STAGE ROCKET. IF YOU HAPPEN TO FIX IT PLEASE LET" 4030 PRINT "ME KNOW.TRICK-- YOU CAN ALSO EXCEED SOME INPUT PARAMETERS. " 4040 PRINT 4050 PRINT "FOR A FASTER GAME USE 1 FOR TIME. FUEL SHOULD BE ABOUT FIVE " 4060 PRINT "TIMES THAT OF HULL WEIGHT. ALSO ADD ABOUT 20% TO THRUST NUMBER. " 4070 PRINT :PRINT "ENJOY! THATS ALL I'M GOING TO TELL YOU. 4080 PRINT :INPUT "HIT RETURN TO GO ON";ZZ$ 4090 PLOT 12 4100 RETURN