feigenbaum.py

Created by schraf

Created on September 01, 2019

302 Bytes

On fait varier a entre 2 et 4 par exemple avec un pas de 0.01

La première boucle permet d’arriver à un comportement limite (100 itérations) de u(n+1)=au(n)(1-u(n))

On trace ensuite les 20 points suivants (u(101) à u(120))

https://fr.wikipedia.org/wiki/Nombres_de_Feigenbaum


from kandinsky import *
def feig(m=2,M=4,pas=0.01,pts=50):
  a = m
  while a < M:
    x = 0.5
    for k in range(100):
      x = a*x*(1-x)
    for k in range(pts):
     x = a*x*(1-x)
     px = int(320*(a-m)/(M-m))
     py = 220-int(220*x)
     set_pixel(px,py,color(0,0,0))
    a+=pas

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.