%Matlab code for Exercise 1(c,d), page 67 (Devaney's text) %Change the code below for 1(c,d). It is set up to see 1(c). % To see 1(d), comment out line 9 (percentage sign in front), % remove the comment from line 10 (delete the percent sign) % and change y2 back to y1 in line 17 (unless you want to see the second % iterate). cvals=0:-0.05:-1.5; %Choose a range for the bifurcation parameter %cvals=0:0.05:1.5; %Parameter range for 1(d) N=length(cvals); %Number of plots in the animation x=linspace(-2,2,200); %Domain of the plot- the interval from -2 to 2 for j=1:N y1=cvals(j)*x+x.^3; y2=cvals(j)*y1+y1.^3; %Second composition, if desired plot(x,x,x,y2); %Change the last entry to y1, y2 % These correspond to F, F^2, F^3, F^4 axis([-2,2,-2,2]); fprintf('c value is %f \n',cvals(j)) pause end