Key concepts are marked in red .
More on Jupyter notebooks: www.jupyter.org
%pylab notebook
import warnings
warnings.filterwarnings('ignore')
xt+1=F(xt) xt+1=axt(1−xt)
def ff(x):
return 4.0*x*(1-x)
xp=np.pi/10
for t in range(100):
x=ff(xp)
print(xp)
x1=xp
x2=x1+0.0001
x=np.array([x1,x2])
listx=[]
listt=[]
for t in range(100):
listx.append(x)
listt.append(t)
x=ff(x)
plot(listt,listx,'-o');
x1=0.34347036018297582682
x2=x1+0.000001
x=np.array([x1,x2])
listx1=[]
listx2=[]
listt=[]
for t in range(50):
listx1.append(x[0])
listx2.append(x[1])
listt.append(t)
x=ff(x)
plot(listt,listx1,'-o')
plot(listt,listx2,'-o')
x1s=np.array(listx1)
x2s=np.array(listx2)
pyplot.yscale('log')
xlabel("t")
ylabel("$|x(t)-x'(t)|$")
plot(listt,abs(x1s-x2s))
Δx(t)=Δx(0)etlnλ
x=np.arange(0,1,1/50000)
for t in range(1000):
x=ff(x)
ylabel("$\rho(x)$")
xlabel("x")
plt.hist(x,normed=True,bins=100,color="red");
x=0.3141592653589
listx=[]
listt=[]
for t in range(50000):
listx.append(x)
x=ff(x)
plt.hist(listx,normed=True,bins=100,color="blue");
limT→∞1TT∑t=1h(ft(x0)=∫10h(x)ρ(x)dx
ρ(x)=1π√x(1−x)
x=np.arange(0,1,1/500000)
for t in range(100):
x=ff(x)
plt.hist(x,normed=True,bins=100,color="red");
y=np.arange(0,1,1/500)
plt.plot(y,1/(np.pi*np.sqrt((y*(1-y)))),"--",linewidth=2,color="black");