Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- Y0 = 5000
- Y1 = 4800
- n = int(input())
- Y = [Y0, Y1]
- for i in range(2, n + 1):
- Y.append(500 + 1.8 * Y[i-1] - 0.9 * Y[i-2])
- for i in range(0, n+1):
- print("Y", i, " = ", Y[i], sep="")
- plt.plot(Y)
- plt.ylabel('Yt')
- plt.xlabel('t')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement