Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2.  
  3. Y0 = 5000
  4. Y1 = 4800
  5. n = int(input())
  6. Y = [Y0, Y1]
  7. for i in range(2, n + 1):
  8.     Y.append(500 + 1.8 * Y[i-1] - 0.9 * Y[i-2])
  9.  
  10. for i in range(0, n+1):
  11.     print("Y", i, " = ", Y[i], sep="")
  12.    
  13. plt.plot(Y)
  14. plt.ylabel('Yt')
  15. plt.xlabel('t')
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement