How can I find fixed points for a map with a range of r values?

In summary, the code you provided finds two fixed points and demonstrates the stability of those points. Explaining the code in more detail would be more helpful.
  • #1
ggeo1
63
0
Hello , i wanted to ask sth

I have a map : xn+1=rxne-xn , r>0 and r<20

I want to find fixed points .My problem is that i don't have a value or r.I can't manipulate the r values.

(if i had an r value i would do : r=2;)

My code is:

y[x_]:= r x Exp[-x];

To find the fixed points :

fp= Solve[y[x]-x==0 , x]

My output is:

Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

{{x -> 0}, {x -> Log[r]}}

The problem is that the answer is with values of r.

Any ideas?
 
Physics news on Phys.org
  • #2
Is "sth" supposed to mean something besides "somatotropin: a hormone produced by the anterior pituitary gland"? If it does, please type out the word you mean, this makes it possible for members (especially those who speak English as a second language) to undersatnd what you are saying.
 
  • #3
A fixed point is when xn no longer changes, so
xn+1=r xne-xn becomes
x = r x e-x and if x is nonzero that leaves 1 = r e-x.

This is solved to give x = log(r) (or x = 0 if it ever hits zero during its evaluation).

So x = log(r) and x = 0 are the only first order fixed points.
For r <= 1 the x=log(r) solution is unstable and the x=0 solution is stable. For r>1 the x=0 solution is unstable.

At about r=7.4 the x=log(r) becomes unstable and the system bifurcates.
The stable solutions are now solutions to x=e- x e-x(ex+r) r2 x.

Then you get the standard story of period doubling -> chaos -> period 3 -> doubling -> chaos -> etc...

You can generate a nice picture in Mathematica using something like

Code:
f=Compile[{{n,_Integer},{x0,_Real},{r,_Real}},Union[NestList[r # Exp[-#]&,x0,n][[-10;;-1]]]];
Show[{
  ListPlot[Flatten[Table[Thread[{r,f[1000,.01,r]}],{r,0,40,.01}],1],PlotStyle->PointSize[Tiny]],
  Plot[Log[r],{r,0,40},PlotStyle->Red]}]

5181371778_536fc5eb2a.jpg


To understand this better, you can read up about the canonical example:
http://en.wikipedia.org/wiki/Logistic_map
 
Last edited:
  • #4
First of all , thank you very much for your complete information!

I am beginner in mathematica , so i can't undestand the code you send me.

My code is :

Code:
y[x_] := r x Exp[-x];
(* Find the fixed points*)

fp = NSolve[y[x] - x == 0, 
   x]; (* Here is the problem that i can't "insert" r somehow*)

Print ["Fixed points are " , fp];
(* Find the stability points*)
(* k is the stability index , if k>0 \unstable ,if k<0 stable*)

(* \[Lambda] is the stability index , if |\[Lambda]|<1 linear \stability ,if |\[Lambda]|>1 linear instability,if |\[Lambda]|=1 \
parabolic stability*)

\[Lambda][x_] = D[y[x], x]
x1 = x /. fp[[1]]; x2 = x /. fp[[2]];
Print [ "The first fixed point is " , x1 ,   "Stability index \[Lambda] = ", \[Lambda][x1]];
Print [ "The second fixed point is " , x2 ,  "Stability index \[Lambda] = ", \[Lambda][x2]];

If you know how can i insert 0<r<20 in my function with this kind of code..Unfortunately i can't do "fp = NSolve[y[x] - x == 0, x , {r,0,20} ]"
 
Last edited:
  • #5
I think you need to really think about what you want Mathematica to do for you.
For finding the stability indices, you probably want to stay symbolic the whole time.

I've attached a notebook that should do everything you want. Here's a screen shot of it:
attachment.php?attachmentid=29891&stc=1&d=1289914104.png
 

Attachments

  • PF448090-Chaos.nb.zip
    2.9 KB · Views: 323
  • PF448090-Chaos.png
    PF448090-Chaos.png
    17.6 KB · Views: 1,041
  • #6
Thank you very much!
I am studying it right now.

I used y[x_,r_]:=r x Exp[-x]
but then i did a mistake i think at Solve[y[x, r] == x, x]

But i would have not think the
Solve[(1 - Log[r])^2 == 1, r]
!

Thanks again!
You were very helpful and understanding.
 
  • #7
Hello,

I have only one question for the fixed point x=1-Log[r].
If 1-logr<1 =>-logr<0 => logr>0 => r>1 then the point is stable.
Until here ,ok.

Why you are trying to solve (1-logr)^2=1 ?
(You are trying to find the limit of r value for the equation to be stable,but i can't figure the way)

As for the bifurcation diagram i did it with iterations with "while" and "if" commands and as i can see its the same.

Thanks!
 
  • #8
Simon_Tyler said:
You can generate a nice picture in Mathematica using something like

Code:
f=Compile[{{n,_Integer},{x0,_Real},{r,_Real}},Union[NestList[r # Exp[-#]&,x0,n][[-10;;-1]]]];
Show[{
  ListPlot[Flatten[Table[Thread[{r,f[1000,.01,r]}],{r,0,40,.01}],1],PlotStyle->PointSize[Tiny]],
  Plot[Log[r],{r,0,40},PlotStyle->Red]}]

Sorry for asking in this old thread, but my problems are related to this code which I'm trying to learn.
What's the meaning of the [[-10;;-1]] span? I really cannot understand it, and breaking the function in smaller parts doesn't help...
 
  • #9
Hi cenit, not a problem.

[[]] is an abreviation for http://reference.wolfram.com/mathematica/ref/Part.html" , and as explained in the documentation, negative integers reference a position from the end.

Assume you have a list called L. Then
L[[1]] gives the first element.
L[[1;;5]] gives the first 5 elements.
L[[1;;7;;2]] gives the elements 1,3,5,7.
L[[-1]] gives the last element
L[[-10,-1]] gives the last 10 elements.

I did this in the definition of the function f, this since we need the recursion to stabilize onto the attractive solutions - thus we keep the last 10 points and throw away the "junk" that came before. There are probably more smart and more efficient ways to do this, but for a quick forums solution, it was enough.
 
Last edited by a moderator:
  • #10
Simon_Tyler said:
Hi cenit, not a problem.

[[]] is an abreviation for http://reference.wolfram.com/mathematica/ref/Part.html" , and as explained in the documentation, negative integers reference a position from the end.

Assume you have a list called L. Then
L[[1]] gives the first element.
L[[1;;5]] gives the first 5 elements.
L[[1;;7;;2]] gives the elements 1,3,5,7.
L[[-1]] gives the last element
L[[-10,-1]] gives the last 10 elements.

I did this in the definition of the function f, this since we need the recursion to stabilize onto the attractive solutions - thus we keep the last 10 points and throw away the "junk" that came before. There are probably more smart and more efficient ways to do this, but for a quick forums solution, it was enough.

thanks a lot. I missed the negative integers explanation somehow, even if I was looking for it...
 
Last edited by a moderator:

1. What is a fixed point in mathematics?

A fixed point in mathematics is a number that, when put into a function, gives back the same number. In other words, it is a point that stays "fixed" when the function is applied to it. Mathematically, it is represented as f(x) = x, where f is the function and x is the fixed point.

2. How does Mathematica find fixed points?

Mathematica uses various algorithms and numerical methods to find fixed points in a given function. These include the bisection method, Newton's method, and the fixed-point iteration method. It also has built-in functions such as FindRoot and FixedPoint that can be used to find fixed points.

3. Can Mathematica find multiple fixed points in a single function?

Yes, Mathematica can find multiple fixed points in a single function. It can either find all the fixed points or a specific number of them, depending on the algorithm or method used. For example, the FixedPointList function can be used to find all the fixed points of a given function.

4. How are fixed points useful in real-world applications?

Fixed points have many applications in various fields, including science, engineering, economics, and biology. They can be used to model and analyze systems that exhibit stability or equilibrium, such as population growth, chemical reactions, and electrical circuits. They are also used in optimization problems to find the maximum or minimum values of a function.

5. Can Mathematica be used to visualize fixed points?

Yes, Mathematica has powerful visualization tools that can be used to plot and visualize fixed points in a function. This can help in understanding the behavior of the function and its fixed points, as well as in identifying and analyzing different types of fixed points, such as stable, unstable, and semi-stable fixed points.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • General Math
Replies
1
Views
717
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Math Proof Training and Practice
2
Replies
69
Views
4K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
Replies
8
Views
2K
  • Introductory Physics Homework Help
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
669
Replies
7
Views
1K
Back
Top