Finding fixed points / attractors / repellors of a Tent map

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 of f(x)=x; in other words, the point where the function maps it to itself.

Solving for your function, you get x=0 and x=3/4 as fixed points.

In:= Solve[Min[3/2 x, 3 - 3 x] - x == 0, x]

Out= {{x -> 0}, {x -> 3/4}}

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

Manipulate[
 CobwebDiagram[xstart, steps], {xstart, 0, 1, 1/1000}, {steps, 1, 200,
   1}] 

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

eps = 10^-16;
CobwebDiagram[0.75 + eps, 200]

we get

Fig. (1)

enter image description here

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 diverges

Clear[f]
f[1] = 0.75 + eps;
f[t_] := f[t] = 
   Piecewise[{{3/2 f[t - 1], 0 <= f[t - 1] <= 2/3}}, 3 (1 - f[t - 1])];
ListLinePlot[Table[f[n], {n, 1, 200}]]

Fig. (2)

enter image description here

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)

enter image description here

Fig. (4)

enter image description here

Now consider the starting point x[1]=18/25.

CobwebDiagram[18/25, 200] 

Fig. (5)

enter image description here

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 the x[t], you see something like

Fig. (6)

enter image description here

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 and 21/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)

enter image description here

Fig. (8)

enter image description here

Interestingly, starting with x[1]=19/25 maps it to 18/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 from 19/25 on to y=x is just the continuation of the line from 12/25 to y=x (i.e., from the first piece of the function). By the same logic, there should be points corresponding to 18/25 and 21/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 to 3/4 in the next step, which is a fixed point and hence stays there forever. Similarly, the point 2/3 takes you to the other fixed point at 0.

CobwebDiagram[1/2, 200]

Fig. (9)

enter image description here

CobwebDiagram[2/3, 200]

Fig. (10)

enter image description here

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 to 0, it takes longer for it to recover than at 3/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.


To make questions easier to be answered for Mathematica versed folks, here is the Mathematica rendition on the code above:

CobwebDiagram[xstart_, steps_] := Module[{path, x, t},
  path = RecurrenceTable[{x[t] == 
      Piecewise[{{3/2 x[t - 1], 0 <= x[t - 1] <= 2/3}}, 
       3 (1 - x[t - 1])], x[1] == xstart}, x, {t, 1, steps}];
  Plot[Piecewise[{{3/2 x, 0 <= x < 2/3}}, 3 (1 - x)], {x, 0, 1}, 
   Epilog -> {Red, 
     Line[Riffle[Partition[path, 2, 1], {#, #} & /@ Rest[path]]]}]]

enter image description here


Somehow, I thought this to be a homework question when I first saw it and the OP's response to Yoda's answer verifies this. It's not necessarily wrong to ask homework questions but it should certainly be clearly marked as such. There are some reasonable homework policies at this link on meta: https://meta.stackexchange.com/questions/18242/what-is-the-policy-here-on-homework

Taking into account the policy "no homework solutions; nudges welcome", there is one comment I'd add to the solutions discussion I've provided so far. Examine the graphs of the iterates of f. By this I mean the graphs of f(f(x)), f(f(f(x))), etc. For example, the third iterate of f(x)=x^2 is f(f(f(x)))=x^8. The points of intersection between the graph of the nth iterate of f and the line y=x include the periodic orbits of order n (and a bit more). Examining these pictures, it should become clear that there are lots of repulsive orbits.

The correct way to fully classify the dynamics is to use symbolic dynamics, which your class might or might not have covered.