Telechargé par fghg3

logistique python

publicité
#équation logistique
import numpy as np
import matplotlib.pyplot as plt
rmin=0
rmax=100
nbr=10
dr=0.02
# suite logistique
def logit(n):
x=[0.]
r=2.3
for i in range(1,n+1):
x.append(r*x[i-1]*(1-x[i-1]))
#print(x)
return x
x=logit(49)
print(logit(50))
t=np.linspace(0,50,50)
plt.plot(t,x)
plt.show()
Téléchargement