Re: The Logistic Map [message #1833] |
Fri, 04 March 1994 07:48 |
andy
Messages: 31 Registered: November 1993
|
Member |
|
|
In article <1994Mar3.160025.29736@rockyd.rockefeller.edu>, darren@sticky.rockefeller.edu (Darren Orbach) writes:
> Keywords:
>
> Greetings.
> I am trying to plot out the evolution of the logistic equation,
> iterating x(i+1)=r*x(i)(1-x(i)), for r in [0,4). I'd like IDL to plot a
> point for each value through the iteration. The problems are that I keep
> getting floating underflows, and I can't generate the right results. The
> code is just this simple bit:
>
> Function Map, r, x
>
> return, r*x*(1.0-x)
>
> END
>
>
> Pro Logistic
>
> y = intarr(100) & y(*) = 0
> plot, y, xrange = [0, 4], yrange = [0, 1]
> for i = 0,799 do begin
> r = i/200.0
> x = 0.5
> for j = 0, 299 do begin
> x = Map(r,x)
> endfor ; to get rid of transients
> for j = 0, 1999 do begin
> x = Map(r,x)
> k = fix(x * 600) ; plot the nearest integer
> ; to x*600
> plots, r, k
> endfor
>
> END
>
>
> In addition to this particular example, is there a much more optimal way of
> doing recursive calculations in IDL about which I'm simply not aware?
> Thanks in advance.
> -Darren Orbach
Darren,
I am not terribly familiar with the logistic equation (I believe it's a
population estimator which often goes chaotic), but I can see that by
allowing r to be so small, your value of x in the first j-loop (0, 299)
is going to get very small. This is probably the source of your underflow
error. A print statement in that loop would verify this.
Andy
--
------------------------------------------------------------ --------------------
,__o Andrew F. Loughe
_-\_<, Goddard Space Flight Center
(*)/'(*) Code 971 Bldg. 22 Room 335 phone : (301) 286-5899
=========== Greenbelt, MD 20771 e-mail: andy@toto.gsfc.nasa.gov
------------------------------------------------------------ --------------------
|
|
|