Personal tools

universalplot.py

Plot the orbits of f**2**n at the r_m superstable point, in a matrix format. For the diagonals of this plot displayed horizontally, see universalhorizontal.py

universalplot.py — Python Source, 0Kb

File contents

#!
from superstable import *
from pylab import *

rsuper = getsuperstablevalues()

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)

for RL in range(1,4):
    for FL in range(0,3):
        subplot(3,3,3*RL+FL+1-3) # ugly hack.
        # RL in vertical coords, FL in horizontal coord. 

        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