# Invoke with "ipython notebook --pylab=inline", then open logistic_jim from dashboard.
def logistic(a, n=20, skip=100, x=0.43):
""" Return list of values for the logistic map"""
result = []
for i in xrange(n + skip):
if i > skip:
result.append(x)
x = a*x*(1.0-x)
return result
def bifurcation(a_min=2.6, a_max=3.8, acount=200):
""" Return list of points for bifurcation plot """
a_values = []
x_values = []
for a in arange(a_min, a_max, (a_max-a_min)/acount):
for x in logistic(a):
a_values.append(a)
x_values.append(x)
return a_values, x_values