You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

29 lines
378 B

  1. from matplotlib import pyplot
  2. import numpy
  3. import sys
  4. k = float(sys.argv[1])
  5. def f(x):
  6. return k * x * (1 - x)
  7. x0 = 0.5
  8. n = 200
  9. def liste(n):
  10. resultat = [x0]
  11. for i in range(n):
  12. resultat.append(f(resultat[-1]))
  13. return resultat
  14. abscisses = list(numpy.linspace(0, 10, n + 1))
  15. ordonnées = liste(n)
  16. pyplot.plot(abscisses, ordonnées)
  17. pyplot.show()