""" From "A SURVEY OF COMPUTATIONAL PHYSICS", Python eBook Version by RH Landau, MJ Paez, and CC Bordeianu Copyright Princeton University Press, Princeton, 2012; Book Copyright R Landau, Oregon State Unv, MJ Paez, Univ Antioquia, C Bordeianu, Univ Bucharest, 2012. Support by National Science Foundation , Oregon State Univ, Microsoft Corp""" # Bugs.py creates bifurcation diagram for Logistic Map #from visual.graph import * from pylab import * m_min = -1.0; m_max = -0.; step = 0.0025 #m_min = 1.5; m_max = 3.5; step = 0.0125 #m_min = 3.0; m_max = 4.0; step = 0.005 #m_min = 3.4; m_max = 3.6; step = 0.0025 #m_min = 3.53; m_max = 3.57; step = 0.0005 #m_min = 3.6; m_max = 3.7; step = 0.001 #m_min = 3.82842; m_max = 3.82843; step = 0.000001 lasty = int(1000 * 0.5) # to eliminate later some points count = 0 # to plot later every two iterations b = 5 # 1 4 for m in arange(m_min, m_max, step): y = 0.5 for i in range(1,101,1): # to avoid transients # y = y*exp(m*(1-y)) y = exp(-b*y**2) + m # Gauss not working for i in range(201, 402, 1): # to avoid transients # y = y*exp(m*(1-y)) y = exp(-b*y**2) + m # Gauss not working inty = int(10000 * y) if inty != lasty and count%2==0: plot(m,y,".b",markersize=1)# no repeats lasty = inty count += 1 show()