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.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.
 
 
 
 
 
 

29 regels
458 B

  1. import numpy
  2. from matplotlib import pyplot
  3. import sys
  4. ITERATIONS = 1000
  5. def suite(initial, k):
  6. ts = numpy.linspace(0, 1, ITERATIONS)
  7. x = initial
  8. vs = []
  9. for i in ts:
  10. vs.append(x)
  11. x = x * k * (1 - x)
  12. return (ts, vs)
  13. def main():
  14. k = float(sys.argv[1])
  15. # 1.2 ou 2.8 ou 3.5 ou 3.86
  16. ts, vs = suite(0.5, k)
  17. ts, vs2 = suite(0.4, k)
  18. pyplot.plot(ts, vs)
  19. pyplot.plot(ts, vs2)
  20. pyplot.show()
  21. main()