Advertisement
Guest User

Op code niga wott

a guest
Nov 26th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. from math import
  2. masa = 75
  3. gravedad = 9.8
  4. alpha = 5500.0
  5. beta = 0.0069
  6. alturaInicial = 36068
  7. velocidadInicial = 0
  8. re = 6371009.0 # Radio de la tierra
  9. nu = 0.4
  10.  
  11.    
  12.  
  13. def c(y, t):
  14.     return (nu*t + (3-t)*beta*(e**(-y/alpha)))/3.0
  15.  
  16. def g(y):
  17.     return gravedad * ((re/(re+y))**2)
  18.  
  19. def uNMasUno(un, vn, h):
  20.     return un + h*vn
  21.  
  22. def vNMasUno(un, vn, h, t):
  23.     return (1-(1-4*h*c(un,t)*(vn-h*gravedad))**0.5)/(2*(h*c(un,t)))
  24.  
  25.  
  26. h = 0.25
  27. t = 0
  28. altura = alturaInicial
  29. alturaEstrella = 0
  30. velocidad = velocidadInicial
  31. duracion = 0
  32. vmax = 0
  33. while altura > 0:
  34.     duracion += h
  35.     if altura <= 1500 and t < 3:
  36.         t += h
  37.     alturaEstrella = round(uNMasUno(altura, velocidad, h),5)
  38.     velocidad = round(vNMasUno(alturaEstrella, velocidad, h, t), 5)
  39.     altura = round(uNMasUno(altura, velocidad, h),5)
  40.     pasoCritico = abs(1/(c(altura,t)*velocidad))
  41. #    if h >= pasoCritico:
  42. #        break
  43.     if velocidad < vmax:
  44.         vmax = velocidad
  45.     print velocidad/1000*-3600, duracion
  46. print duracion
  47. print vmax/1000*3600
  48. variable = raw_input('input something!: ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement