%Script file to produce the "bifurcation diagram" % for F(x) = lambda x - x ^3 % This will show the pitchfork for period 1 points % and the 2-cycle bifurcation. t1=linspace(-2,5); y1=zeros(size(t1)); %This is our fixed point at the origin. t2=linspace(-3,3); %We'll plot (y2,t2) for the sideways parabola y2=t2.^2+1; t3=linspace(-3,3); y3=t3.^2-1; plot(t1,y1,'r-',y2,t2,'k-',y3,t3,'m-') axis([-2,3,-2,2]) legend('x_0=0','Period 1 Bifurcation','Period 2 Bifurcation') title('Bifurcation Diagram: \lambda x - x^3: Note Fig 6.15') xlabel('\lambda') ylabel('Fixed Point/Period 2 Point');