%Script file to show the dynamics of points under x^2+c for % differing values of c=-2 and one choice below that echo on % % Set 1: These graphs are for c=-2 % %The fixed points are pplus and pneg below: c=-2; f=inline('x.^2-2'); pplus=(1/2)*(1+sqrt(1-4*c)); pneg=(1/2)*(1-sqrt(1-4*c)); %Choose points in the intervals: >pplus, between -pplus and +pplus % and less than -p+: x=linspace(-pplus,pplus,30); s=length(x); for j=1:s figure(1) y=cobweb2(f,x(j),50,-2.5,2.5,-2.5,2.5); figure(2) plot(y) axis([0 50 -2 2]) pause figure(1) clf end % % Set 1: These graphs are for c<-2 % %The fixed points are pplus and pneg below: c=-2.1; f=inline('x.^2-2.1'); pplus=(1/2)*(1+sqrt(1-4*c)); pneg=(1/2)*(1-sqrt(1-4*c)); %Choose points in the intervals: >pplus, between -pplus and +pplus % and less than -p+: x=linspace(-pplus,pplus,20); s=length(x); for j=1:s figure(1) y=cobweb2(f,x(j),50,-2.5,2.5,-2.5,2.5); figure(2) plot(y(1:40)) axis([1 40 -2 3]); pause figure(1) clf end echo off