ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.8 KiB

  1. 10 REM PRECESSION OF A SATELLITE'S ORBIT DUE TO J2
  2. 20 REM
  3. 30 GOSUB 260: J=0
  4. 40 INPUT "Planet's name"; P$
  5. 50 FOR K=1 TO 9
  6. 60 IF P$=PL$(K) THEN J=K
  7. 70 NEXT
  8. 80 IF J=0 THEN 40
  9. 90 REM
  10. 100 INPUT "Altitude of the satellite orbit (km)"; A
  11. 110 INPUT "Inclination to the equator (degrees)"; I
  12. 120 I=I/RD: REM Convert to radians
  13. 130 REM
  14. 140 K1=R(J)*R(J) * (R(J)+A)^(-3.5) * SQR(GM(J))
  15. 150 N=-1.5*K1*J2(J)*COS(I)
  16. 160 P=.75*K1*J2(J) * (5*COS(I)*COS(I)-1)
  17. 170 N=N*RD*S: P=P*RD*S: REM Radians/sec to deg/day
  18. 180 REM
  19. 190 PRINT "Precession of the node: "
  20. 200 PRINT " ";N;"deg/day, ";N*Y;"deg/yr"
  21. 210 PRINT
  22. 220 PRINT "Precession of pericenter: "
  23. 230 PRINT " ";P;"deg/day, ";P*Y;"deg/yr"
  24. 240 REM
  25. 250 END
  26. 260 REM READ IN DATA
  27. 270 DIM PL$(9), GM(9), J2(9), R(9)
  28. 280 RD=180/3.14159265#: REM Radians to degrees
  29. 290 Y=365.2422: REM Days per year
  30. 300 S=86400: REM Seconds per day
  31. 310 REM
  32. 320 DATA "MERCURY","VENUS","EARTH","MOON","MARS"
  33. 330 DATA "JUPITER","SATURN","URANUS","NEPTUNE"
  34. 340 FOR J=1 TO 9: READ PL$(J): NEXT
  35. 350 REM
  36. 360 REM PLANETARY GM'S (KM^3/S^2)
  37. 370 DATA 22032, 324860, 398600, 4902, 42828
  38. 380 DATA 125680000, 37931000, 5793900, 6835000
  39. 390 FOR J=1 TO 9: READ GM(J): NEXT
  40. 400 REM
  41. 410 REM PLANETARY J2'S
  42. 420 DATA 0.00006, 0.0000186, 0.001083, 0.0002027
  43. 430 DATA 0.00196,0.014736,0.016480,0.003345,0.0043
  44. 440 FOR J=1 TO 9: READ J2(J): NEXT
  45. 450 REM
  46. 460 REM PLANETARY RADII (KM)
  47. 470 DATA 2440, 6050, 6378, 1738, 3398
  48. 480 DATA 71492, 60268, 25559, 24760
  49. 490 FOR J=1 TO 9: READ R(J): NEXT
  50. 500 RETURN
  51. 510 REM
  52. 520 REM This program by Anthony Mallama predicts how
  53. 530 REM a satellite in a low orbit around the Earth
  54. 540 REM or any other planet will change due to the
  55. 550 REM planet's equatorial bulge. It is described
  56. 560 REM fully in Sky & Telescope, May, 1990, page 543.