I am a beginner into chaos and nonlinear dynamics. I was trying to plot the phase space plot for Tent Map using Matlab. A phase space plot is a plot of its independent variables. So, if a system has one variable, then it will be a plot of the previous vs the next value. The outline of the plot resembles the Tent Map, but I am getting several cross lines. The phase space plot should look like a triangle (hence the name Tent) bounded between zero and one. If the parameter is mu, then the highest value should be mu/2. The correct phase space plot should be
I tried for other discrete maps as well and getting similar lines. However in books and all, I have seen a clean curve with no lines as such. Where am I going wrong? Also, the plot does not start from zero in the X axis. This Question is from the perspective of programming and concepts as well. I do not know how to get the graph of x[n] vs x[n-1]
as shown in the plot given in wikipedia.
Here is the Matlab code for the Tent map, where the parameter mu = 2
.
N = 256;
x(1) = rand(); % Initial condition
for j=2:N
if (double(x(j-1)))>0 && (double(x(j-1)))<0.5
x(j)=2*x(j-1);
elseif (double(x(j-1)))>=0.5
x(j)=2*(1-x(j-1));
end
end
for k = 2:N
next(k) = x(k-1);
end
plot(next,x)