I need to find fixed points and attractors of a Tent map function given by the definition below:
xt = (3/2) * xt-1 when 0 <= x <= (2/3) and xt = 3* (1-xt-1) when (2/3) <= x <= 1
I am using the MATLAB code below to generate a cobweb diagram (shown below the code) to see if I can get some insight in to this particular tent map function. As you can see I am starting out by setting t=1 (and x(1) = 0.2001), but there are infinitely many possible places to start at. How can you determine fixed points/attractors if you don't test each and every starting point?
clear
close all
% Initial condition 0.2001, must be symbolic.
nmax=200;
t=sym(zeros(1,nmax));t1=sym(zeros(1,nmax));t2=sym(zeros(1,nmax));
t(1)=sym(2001/10000);
mu=2;
halfm=(2/3) *nmax;
axis([0 1 0 1]);
for n=2:nmax
if (double(t(n-1)))>0 && (double(t(n-1)))<=2/3 % 0 <= x <= (2/3)
t(n)=sym((3/2)*t(n-1)); % x(t) = (3/2) * x(t-1)
else
if (double(t(n-1)))<1 % else (2/3) <= x <= 1
t(n)=sym(3*(1-t(n-1))); % x(t) = 3* (1-x(t-1))
end
end
end
for n=1:halfm
t1(2*n-1)=t(n);
t1(2*n)=t(n);
end
t2(1)=0;t2(2)=double(t(2));
for n=2:halfm
t2(2*n-1)=double(t(n));
t2(2*n)=double(t(n+1));
end
hold on
fsize=20;
plot(double(t1),double(t2),'r');
x=[0 (2/3) 1];y=[0 mu/2 0];
plot(x,y,'b');
The following cobweb diagram is for t(1) = 0.2001
These are just some insights from poking around the problem. I'll continue with using Mathematica for now as it is more convenient (and judging by your code above, you should be able to manage this in MATLAB, if not, I'll try and convert it). However, if you do have Mathematica, and can test these out that would be great.
Fixed point: A fixed point of a function
f(x)
is a point that's the solution off(x)=x
; in other words, the point where the function maps it to itself.Solving for your function, you get
x=0
andx=3/4
as fixed points.Indeed, a trajectory that starts at these points will stay at these points forever. You can also interactively observe the effects as you change the starting point and the number of iterations using
Nature of the fixed points
Let's look at the nature of the fixed points. If it's an attractor, points in an arbitrarily small epsilon sized neighborhood of the fixed point stay in a similar sized neighborhood (need not necessarily be the exact same size), and if it's a repellor, it gets repelled and diverges to a completely arbitrary point outside the neighborhood (my definitions are pretty loose here, but guess will do).
So trying the following
we get
Fig. (1)
which certainly doesn't look like it is converging to the fixed point. Indeed, if you look at the evolution of
x[t]
, you'll see that it divergesFig. (2)
The result is similar if you perturb it in the other direction, i.e.,
f[1]=0.75-eps
.For the other fixed point (this time, it can be perturbed only in one direction as the function is defined for
x>=0
), you'll see that the behaviour is the same, and hence the two fixed points appear to be divergent.Fig. (3)
Fig. (4)
Now consider the starting point
x[1]=18/25
.Fig. (5)
Whoa!! That looks like a limit cycle!
Limit cycle: A limit cycle is a closed trajectory of the system from which there is no possibility of reaching a point not on the trajectory, even as
t->Infinity
. So, when you look at thex[t]
, you see something likeFig. (6)
which is just 3 points repeated (the image compression creates a Moiré pattern, but really, if you plot it for a small # of steps, you'll see 3 points. I'm just too sleepy to go back and replot it). The three points are
12/25
,18/25
and21/25
. Starting with any of these three points will take you to the same limit cycle.Now if trajectories sufficiently close to the limit cycle converge to it, it is an attracting/stable limit cycle, else it's a repelling/unstable limit cycle. So perturbing by
eps
in either direction as before, we see that the trajectory diverges (I'm only showing +ve direction below).Fig. (7)
Fig. (8)
Interestingly, starting with
x[1]=19/25
maps it to18/25
in the next step, which then continues on indefinitely in the limit cycle trajectory. It is easy to see why this happens, as the line from19/25
on toy=x
is just the continuation of the line from12/25
toy=x
(i.e., from the first piece of the function). By the same logic, there should be points corresponding to18/25
and21/25
, but I'm not going to find them now. In light of this, I'm not exactly sure here as to whether the limit cycle here is truly attracting or repelling (as per the strict definition of limit cycle, there needs to be only one other trajectory that spirals into it, and we've found three! Perhaps someone who knows more on this can weigh in on this).Some more thoughts
The starting point
1/2
is also interesting, because it takes you to3/4
in the next step, which is a fixed point and hence stays there forever. Similarly, the point2/3
takes you to the other fixed point at0
.Fig. (9)
Fig. (10)
The behaviour of the oscillations also tell you something about the system. If you look at the trajectory in Figs. (2,4), the system takes longer to spiral into chaos for the fixed point
0
case, than the other. Also, in both the plots, when the trajectories get close to0
, it takes longer for it to recover than at3/4
, where it just flutters around rapidly. These look similar to relaxation oscillations (think of a capacitor charging slowly and being discharged instantaneously by shorting).That's all I can think of for now. Lastly, I believe the exact nature of the fixed points must be analyzed in the general setting of Lyapunov stability, but I'm not going to embark upon this. I hope this answer has given you a few options to look into.