Lewi7tan

velo

Jul 25th, 2021
674
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2. import matplotlib.pyplot as plt
  3.  
  4.  
  5. def calculate_velocity(ln, u):
  6.     return u * ln
  7.  
  8.  
  9. def calculate_ln(m, r, t):
  10.     fn_parameter = m / (m - r*t)
  11.     return math.log(abs(fn_parameter))
  12.  
  13.  
  14. m0 = 1_320_000
  15. u = 3_750
  16. r = 1_950
  17. time = int(input("podaj czas trwania lotu w sekundach "))
  18.  
  19. xax = [i for i in range(1, time)]
  20. yax = [calculate_velocity(calculate_ln(m0, r, time_stamp), u)
  21.        for time_stamp in xax]
  22.  
  23.  
  24. plt.plot(xax, yax)
  25. plt.ylabel("prędkość")
  26. plt.xlabel("czas")
  27. plt.show()
RAW Paste Data