As said, when plotting my bifurcation plot it does not show its chaotic tendency after r=4a nd it only plots two points at the last given value (in this case 5, but the same applies to any value over 4 or under -2).
def f (A, R):
A = A*(R*((A/N)-1)-1)+N+A
B = N-A
return A
def bifurcation(r, iter):
# One initial condition for each value of r
a = np.linspace(0,1000,len(r))
# We are first going to get rid of the transients
for i in range(5000):
a = f(a,r)
# Assuming we are now on the limit cycle, we plot value of iter outputs
for i in range(iter):
a = f(a,r)
b = N-a
plt.plot(r,a, '.', color = 'r', markersize = 1)
plt.plot(r,b, '.', color = 'b', markersize = 1)
N = 1000
plt.figure()
r = np.arange(0, 5, 0.01)
iter = 100
bifurcation(r, iter)
plt.legend("AB")
plt.show()]
Aucun commentaire:
Enregistrer un commentaire