Personal tools

universal.py

Plot f**2**N and its orbits evaluated at r_M.

universal.py — Python Source, 0Kb

File contents

#!
from superstable import *
from pylab import *

rsuper = getsuperstablevalues()

RL=3 # which superstable r we choose
FL=2 # which function iterate we choose. 

xrange=arange(4000)/3999.0

def ff(x, r, iters ): # assume x can be a vector for plotting
    for i in range(iters):
        x=r*x*(1-x)
    return(x)

r=rsuper[RL]
iter=2**FL

plot(xrange,ff(xrange,r,iter) )
plot( (0,1), (0,1))

orbit = zeros(2**RL)
orbit[0]=0.5

for i in range(1,2**RL): # orbit will contain individual elements of the orbit
    orbit[i]=r*orbit[i-1]*(1.0-orbit[i-1])

forbit = ff(orbit,r,2**FL)

for i in range(2**RL):
    plot( (orbit[i],orbit[i],forbit[i]), (orbit[i],forbit[i],forbit[i]), 'r')

show()
Document Actions