Iterated Function_r_sin_pi_x_2

Iterated Function_r_sin_pi_x_2 preview image

1 collaborator

Tags

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.1 • Viewed 380 times • Downloaded 23 times • Run 0 times
Download the 'Iterated Function_r_sin_pi_x_2' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [    ;; setting globals for model
     mylist
     axis
]

breed [ axis-turtles axis-turtle ]   ;; these are turtles as part (i.e. axes tips) of X and Y axes
breed [ m-turtles m-turtle ]         ;; thes are turtles to be plotted on the final-state diagram

patches-own [    ;; properties of patches used to generate the coordinates axes
  alpha
  omega
]

to setup
  ca
  set mylist list (0) (X0)  ;; setting the intial list of values
  create-axis               ;; to be iterated by logistic function
  setup-alpha               ;; setting components of X and Y axes
  setup-omega

  reset-ticks
end 

to go                                   ;; this is the procedure of iteration

  set mylist lput result mylist         ;; procedure of iteration where the results are added to a list
  if ticks >= Num-iterations [ stop ]   ;; and a new turtle of red color is created with every iteration
                                        ;; result of the iteration serves as x-coordinates for this turtle
create-m-turtles 1 [                    ;; according to which it is plotted on final state diagram
    set color red
    set shape "circle"
    set size 5
    setxy (last mylist * 400 / r-parameter ) (0)
  ]

  if ticks <= (num-iterations) / 1.1     ;; only last 10% of turtles are plotted
  [ask m-turtles [die]]
  tick
end 

to-report result                                    ;; reporter describing the
  report  r-parameter * sin( pi * last mylist / 2)  ;; iteration procedure based
end                                                  ;; on previous iteration result

to create-axis                                         ;; creating X and Y axes
  ask patches with [ pycor = 0 ] [ set pcolor white ]
    create-axis-turtles 1 [
    set color yellow
    set size 8
    set heading -90
    setxy 0 0
  ]
    create-axis-turtles 1 [
    set color yellow
    set size 8
    set heading 90
    setxy 400 0
  ]
end 

to setup-alpha
  ask patch 5 5
  [ set plabel ""
    set plabel-color white ]
end 

to setup-omega
  ask patch 398 5
  [ set plabel ""
    set plabel-color white ]
end 

There is only one version of this model, created about 7 years ago by Victor Iapascurta.

Attached files

File Type Description Last updated
Iterated Function_r_sin_pi_x_2.png preview Preview for 'Iterated Function_r_sin_pi_x_2' about 7 years ago, by Victor Iapascurta Download

This model does not have any ancestors.

This model does not have any descendants.