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.
 
 
 
 
 
 

49 lines
2.4 KiB

  1. 10 REM LOOKBACK.BAS - Lookback Time
  2. 20 REM by Thomas A. Weil
  3. 30 RM = 3700 / 2.7-1
  4. 40 INPUT "Will you enter the (A)ge of the universe or the (H)ubble parameter"; AH$
  5. 50 IF AH$ = "H" OR AH$ = "h" GOTO 90
  6. 60 IF AH$ <> "A" AND AH$ <> "a" GOTO 40
  7. 70 INPUT "Enter age of the universe NOW in billions of years"; TN
  8. 80 TN = TN * 1E+09: GOTO 110
  9. 90 INPUT "Enter Hubble parameter in km/sec/Mpc"; HN
  10. 100 TN = (2 / 3) / (HN / 9.7781E+11)
  11. 110 INPUT "Enter (T)ime THEN or (R)edshift of the light we see NOW"; TR$
  12. 120 IF TR$ = "R" OR TR$ = "r" GOTO 190
  13. 130 IF TR$ <> "T" AND TR$ <> "t" GOTO 110
  14. 140 INPUT "Enter age of the universe THEN in billions of years"; TT
  15. 150 TT = TT * 1E+09: SC = (TN / TT) ^ (2 / 3): RS = SC - 1: IF RS < RM GOTO 230
  16. 160 SM = RM + 1: TM = TN / (SM ^ 1.5)
  17. 170 PRINT : PRINT USING "You can't look back to a time earlier than ####### years"; TM
  18. 180 PRINT : GOTO 110
  19. 190 INPUT "Enter redshift value for the light we see NOW"; RS
  20. 200 SC = RS + 1: TT = TN / (SC ^ 1.5): IF RS < RM GOTO 230
  21. 210 PRINT : PRINT USING "Redshift value too large; nothing at redshift beyond ##### can be seen"; RM
  22. 220 GOTO 160
  23. 230 PRINT : PRINT USING "Age of the universe NOW = ###.#### billion years"; TN / 1E+09
  24. 240 PRINT USING "Age of the universe THEN = ###.#### billion years"; TT / 1E+09
  25. 250 TV = TN - TT
  26. 260 PRINT USING "Light travel time = ###.#### billion years"; TV / 1E+09
  27. 270 SC = (TN / TT) ^ (2 / 3)
  28. 280 PRINT USING "Scale of the universe NOW versus THEN = ####.###"; SC
  29. 290 RS = SC - 1
  30. 300 PRINT USING "Redshift of the light we see NOW = ####.###"; RS
  31. 310 DT = 3 * TT * ((TN / TT) ^ (1 / 3) - 1)
  32. 320 PRINT USING "Distance of object THEN = ##.### billion light-years"; DT / 1E+09
  33. 330 DN = DT * SC
  34. 340 PRINT USING "Distance of object NOW = ##.### billion light-years"; DN / 1E+09
  35. 350 ST = 2 * ((TN / TT) ^ (1 / 3) - 1)
  36. 360 PRINT USING "Speed away from us THEN = ##.### x speed of light"; ST
  37. 370 SN = 2 * ((TN / TT) ^ (1 / 3) - 1) / (TN / TT) ^ (1 / 3)
  38. 380 PRINT USING "Speed away from us NOW = ##.### x speed of light"; SN
  39. 390 HT = (2 / 3) / TT * 9.7781E+11
  40. 400 PRINT USING "Hubble parameter THEN = #######.# km/sec/megaparsec"; HT
  41. 410 HN = (2 / 3) / TN * 9.7781E+11
  42. 420 PRINT USING "Hubble parameter NOW = #######.# km/sec/megaparsec"; HN
  43. 500 REM ========================
  44. 510 REM FROM "ASTRONOMICAL
  45. 520 REM COMPUTING," SKY & TELE-
  46. 530 REM SCOPE, SEPTEMBER 1997
  47. 540 REM ========================
  48. 550 END