SHARE
TWEET

Untitled

a guest Jul 7th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import math
  3.  
  4. sigma = 0.00000005670373
  5. SUN_TEMP_K = 5778
  6. SUN_RADIUS_M = 695700 * 1000
  7. SUN_LUM_WATTS = 1368
  8.  
  9. m = round(random.uniform(0.1,1.8), 2)
  10. print "Working mass:\t%s" % m
  11.  
  12. if m < 0.43:
  13.     l = 0.23*pow(m,2.3)
  14. elif 0.43 < m < 2:
  15.     l = pow(m,4)
  16. elif 2.0 < m < 20:
  17.     l = 1.5*pow(m,3.5)
  18. else:
  19.     l = 3200*m
  20. print "Luminosity:\t%s" % l
  21.  
  22. Lw = l * SUN_LUM_WATTS
  23. print "Luminosity (watts):\t%s" % Lw
  24.  
  25. R = m ** 0.85
  26. print "Radius: %s" % R
  27.  
  28. R_km = R * SUN_RADIUS_M
  29. print "Radius (meters): %s" % R_km
  30.  
  31. T = (Lw / (4.0 * math.pi * sigma * (R_km**2.0))) ** (1.0/4.0)
  32. print "Surface temp: %s" % T
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top