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.

suite_logistique_a.py 885 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import numpy
  2. from matplotlib import pyplot
  3. import sys
  4. # list_abscisses = [0, 1, 2, 3]
  5. # list_ordonnées = [0, 3, 6, -2]
  6. # list_abscisses = []
  7. # list_ordonnées = []
  8. def calcul_suite(const, nb_inter):
  9. list_abscisses = range(0, nb_inter)
  10. x = 0.5
  11. list_ordonnées = []
  12. for i in list_abscisses:
  13. list_ordonnées.append(x)
  14. x = const * x * (1 - x)
  15. return (list_abscisses, list_ordonnées)
  16. def main():
  17. const = sys.argv[1]
  18. const = float(const)
  19. resultat_calcul = calcul_suite(const, 500)
  20. list_abscisses = resultat_calcul[0]
  21. list_ordonnées = resultat_calcul[1]
  22. pyplot.plot(list_abscisses, list_ordonnées)
  23. pyplot.show()
  24. main()
  25. # commandes à lancer
  26. # ./.venv/bin/python3 suite.py 2
  27. # ./.venv/bin/python3 suite.py 3
  28. # ./.venv/bin/python3 suite.py 3.05
  29. # ./.venv/bin/python3 suite.py 3.58
  30. # ./.venv/bin/python3 suite.py 3.58