Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dt = 0.0005
- # params
- a = 15
- b = 3
- c = 4
- d = 24
- # funcs
- def f(x, y):
- return (a*x - b*x*y)*dt + x
- def g(x, y):
- return (c*x*y - d*y)*dt + y
- x0 = 20
- y0 = 4
- x = [x0]
- y = [y0]
- for i in range(5000):
- _x = x[i]
- _y = y[i]
- x.append(f(_x, _y))
- y.append(g(_x, _y))
- # print(x)
- # print(y)
- from matplotlib import pyplot as plt
- plt.plot(x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement