Bifurcation diagram for iterated sin_f
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
NB: For better model performance/visualization it is recommended to download the program and run it on your PC, because on the server it is very slow.
This model is an example of the bifurcation diagram of the iterated function f(x) = r * sin ( π * x / 2 ).
The bifurcation parameter r is shown on the horizontal axis of the plot generated in NetLogo World View Window and the vertical axis shows the set of values of the iterated logistic function.
The bifurcation diagram shows the forking of the periods of stable orbits from 1 to 2 to 4 to 8 etc. Each of these bifurcation points is a period-doubling bifurcation. The ratio of the lengths of successive intervals between values of r for which bifurcation occurs converges to the first Feigenbaum’s constant.
In this model the initial condition (X0) is 0.5 and starting r-parameter-value is 30.
HOW IT WORKS
Every time-step (tick) an iteration is performed and as a result a point is generated (i.e. a green color turtle is created) and it is placed/plotted on the plane (where Y-coordinates are obtained as a result of logistic function iterations and X-coordinates represent every tick r-increments of 0.005, with every new r-value participating in the next-step iteration by definition).
After the diagram is created the first Feigenbaum's constant (δ), which expresses the limit of the ratio of distances between consecutive bifurcations can be calculated. The value of Feigenbaum's constant converges to 4.669201609...
HOW TO USE IT
Press the buttons: (1) Setup: creates basic conditions for the model to run (i.e. erases data from previous runs, generates X and Y axes, etc.)
(2) Go: starts iterations and generation of new points (turtles) in accordance with numeric values as a result of iterations.
(3) Mark bifurcations: this button can be activated only after iterations are completed (in this model after 16900 ticks/iterations). Pressing the button will generate red points (i.e. red color turtles) for the first several bifurcations.
(4) Mark periodic window: this button can also be activated only after iterations are completed. It will point on a well visible periodic window, where chaotic behavior of the system 'suddenly' become 'non-chaotic'.
(5) Calculate 1st Feigenbaum's constant: Pressing this button after iterations ended, will highlight (by vertical white color lines) the regions of bifurcation and calculate (δ) based on x-coordinates of the turtles located in the respective 'bifurcation points'. The distances between such points are marked by L0, L1, L2, etc.
(6) The bottom reporter shows the calculated value of 1st Feigenbaum's constant.
Pressing the buttons 3, 4, 5 before the end of iterations (i.e. before 16900 ticks) will cause no particular changes to the model. The same is valid for the reporter - it will show "N/A" message.
THINGS TO NOTICE
System behavior greatly depends on r value:
The starting value for r-parameter in this model is 30. Respectively, first points in the diagram will have Y-coordinates = 0. With the increase in r-parameter points will get Y-coordinates above '0' with the resulting line leaving '0' y-coordinates and the first bifurcation appearing just after r=90, followed by a period-doubling cascade:
- with r beyond 95: period 4 oscillations until r=98, when the doubling cascade continues with period 8 oscillations, etc.
- an r-value of approximately 99 is the beginning of chaos
- with r between 107.5 and 108.5 we can see a periodic window
During the model run one can observe the result of iterations in time (by ticks): new turtles/points being created and plotted.
Feighenbaum's constant is calculated as the ratio of distances between consecutive bifurcations on diagram: on Li / Li+1. In this model it is calculated as the ratio between x-coordinates of turtles located in the respective specific regions of the bifurcation diagram (i.e. the transition between period 4 and period 8). The calculated and reported value is an approximate.
EXTENDING THE MODEL
For a more precise value of the Feigenbaum's constant a better tuned selection of turtles/points which coordinates are used for calculation would be desirable. Another extension would be using for calculation the mean of x-coordinates of several turtles in the same regions of the bifurcation diagram (i.e. using the mean instead of a single turtle(s) coordinates).
RELATED MODELS
This is one of the models in a suit of models created to visualize some key concepts of Chaos Theory and Dynamical Systems. Most of the models are available on http://modelingcommons.org/account/models/2495
Of a special interest can be the models describing: * Iterated function f(x) = r * sin ( pi * x / 2 ) with a final state-diagram and * Bifurcation diagram for the logistic map
More information can be obtained by comparing the behavior of the same iterated function f(x) = r * sin ( pi * x / 2 ) for different r-values, as described by the respective model and the actual bifurcation diagram model.
CREDITS AND REFERENCES
This simple abstract model was developed by Victor Iapascurta, MD. At time of development he was in the Department of Anesthesia and Intensive Care at University of Medicine and Pharmacy in Chisinau, Moldova / ICU at City Emergency Hospital in Chisinau. Please email any questions or comments to viapascurta@yahoo.com
The model was created in NetLogo 6.0.1, Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
This model was inspired by Introduction to Dynamical Systems and Chaos (Fall, 2017) MOOC by David Feldman @ Complexity Explorer (https://www.complexityexplorer.org/courses).
Comments and Questions
globals [ ;; setting the globals for the model functioning mylist-x mylist-r num-iterations axis F-const? ] breed [ m-turtles m-turtle ] ;; these are turtles to be ploted on ;; on bifurcation diagram patches-own [ ;; properties of the patches used alpha ;; to set up X and Y axes omega ] to setup ca set mylist-x list (0) (0.5) ;; setting the list for turtles x-coordinates set mylist-r list (0) (30) ;; setting the list for turtles y-coordinates set num-iterations 16900 ;; setting the number of iterations create-axis ;; creating coordinates axes setup-coordinates ;; and their components reset-ticks end to create-axis ask patches with [ pxcor = 0 ] [ set pcolor white ] ask patches with [ pycor = 0 ] [ set pcolor white ] end to setup-coordinates ask patch 5 5 [ set plabel "0" set plabel-color white ] ask patch 10 345 [ set plabel "1.0" set plabel-color white ] ask patch -10 200 [ set plabel "f (x)" set plabel-color white ] ask patch 150 -14 [ set plabel "r-parameter" set plabel-color white ] ask patch -19 -5 [ set plabel "30" set plabel-color white ] ask patch 7 -5 [ set plabel "40" set plabel-color white ] ask patch 35 -5 [ set plabel "50" set plabel-color white ] ask patch 65 -5 [ set plabel "60" set plabel-color white ] ask patch 100 -5 [ set plabel "70" set plabel-color white ] ask patch 135 -5 [ set plabel "80" set plabel-color white ] ask patch 170 -5 [ set plabel "90" set plabel-color white ] ask patch 205 -5 [ set plabel "100" set plabel-color white ] ask patch 232 -5 [ set plabel "110" set plabel-color white ] ask patch 234 5 [ set plabel "114" set plabel-color red ] end to go ;; procedure of iteration set mylist-x lput result mylist-x ;; generation of the list with repeat 20 [set mylist-x lput result mylist-x] ;; x-coordinates of turtles set mylist-r lput result-r mylist-r ;; generation of the list with ;; x-coordinates of turtles if ticks >= Num-iterations [ stop ] ;; condition for stopping the model after ;; the preset number of iterations create-m-turtles 1 [ ;; creating a turtle every iteration/tick set color green ;; and ploting it according to the coordinates set shape "circle" ;; as values in the respective lists set size 0.5 set xcor (last mylist-r) * 2 set ycor (last mylist-x) * 3 ] tick end to-report result ;; reports the result of iterations report last mylist-r * sin( pi * last mylist-x / 2) end to-report result-r ;; reports the result of r-increments with every iteration/tick report last mylist-r + 0.005 end to mark ;; marking the bifurcations by creating red color turtles ;; in respective zones if ticks >= 16900 [ ;; condition that makes respective button active only after ;; iterations are completed crt 1 [ set color red set shape "circle" set size 2 set xcor 166 set ycor 223 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 192 set ycor 283 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 198 set ycor 268 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 197 set ycor 272 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 192 set ycor 152 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 198 set ycor 124 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 197 set ycor 180 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 196.88 set ycor 294.58 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 197.99 set ycor 293.4 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 197.94 set ycor 277.31 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 197.12 set ycor 127.85 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 198.04 set ycor 131.96 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 197.96 set ycor 296.84 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 198.07 set ycor 168.56 ] crt 1 [ set color red set shape "circle" set size 2 set xcor 198.11 set ycor 189.32 ] ] end to mark-pw ;; marking a periodic window if ticks >= 16900 [ ask patches with [ pxcor = 212 ] [set pcolor red] ask patches with [ pxcor = 222 ] [set pcolor red] ] end to calculate-feigenbaum-constant ;; procedure ref. to Feigenbaum's constant: ploting ;; vertical lines aligned to bifurcations and marking ;; the distance between consecutive period-doublings with "L" if ticks >= 16890 [ ;; condition that makes the procedure valid after the set F-const? true ;; preset number of iterations ask patches with [ pxcor = 166 ] [set pcolor white] ask patches with [ pxcor = 192 ] [set pcolor white] ask patches with [ pxcor = 197 ] [set pcolor white] ask patches with [ pxcor = 199 ] [set pcolor white] ask patch 116 10 [ set plabel "L0" set plabel-color yellow ] ask patch 180 10 [ set plabel "L1" set plabel-color yellow ] ask patch 205 10 [ set plabel "L2/L3" set plabel-color yellow ] ask patch 130 300 [ set plabel "Feigenbaum's constant = Li / Li+1" set plabel-color yellow ] ] end to-report F-constant-1 ;; procedure for calculation of the 1st Feigenbaum's constant if F-const? = true ;; based on x-coordinates of the turtles located in the [ ;; 'bifurcations zones' report (([xcor] of turtle 13701) - ([xcor] of turtle 13215)) / (([xcor] of turtle 13806) - ([xcor] of turtle 13701)) ] end
There is only one version of this model, created almost 8 years ago by Victor Iapascurta.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bifurcation diagram for iterated sin_f.png | preview | Preview for 'Bifurcation diagram for iterated sin_f' | almost 8 years ago, by Victor Iapascurta | Download |
This model does not have any ancestors.
This model does not have any descendants.