Child of Urban (System Dynamics)
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
;; System dynamics model globals globals [ ;; stock values y1 y2 y3 ;; size of each step, see SYSTEM-DYNAMICS-GO dt ;; Additional global variable sigma r b ] ;; Initializes the system dynamics model. ;; Call this in your model's SETUP procedure. to system-dynamics-setup reset-ticks set dt 0.001 ;; initialize stock values set y1 random-float 0.0 set y2 random-float 1.0 set y3 random-float 0.0 ;; initialize sigma set sigma 10.0 ;; initialize r set r 28.0 ;; initialize b set b 2.6667 end ;; Step through the system dynamics model by performing next iteration of Euler's method. ;; Call this in your model's GO procedure. to system-dynamics-go ;; compute variable and flow values once per step let local-y1' y1' let local-y2' y2' let local-y3' y3' ;; update stock values ;; use temporary variables so order of computation doesn't affect result. let new-y1 ( y1 + local-y1' ) let new-y2 ( y2 + local-y2' ) let new-y3 ( y3 + local-y3' ) set y1 new-y1 set y2 new-y2 set y3 new-y3 tick-advance dt end ;; Report value of flow to-report y1' report ( sigma * (y2 - y1) ) * dt end ;; Report value of flow to-report y2' report ( y1 * (r - y3) - y2 ) * dt end ;; Report value of flow to-report y3' report ( y1 * y2 - b * y3 ) * dt end ;; Plot the current state of the system dynamics model's stocks ;; Call this procedure in your plot's update commands. to system-dynamics-do-plot if plot-pen-exists? "y1" [ set-current-plot-pen "y1" plotxy ticks y1 ] if plot-pen-exists? "y2" [ set-current-plot-pen "y2" plotxy ticks y2 ] if plot-pen-exists? "y3" [ set-current-plot-pen "y3" plotxy ticks y3 ] end
There is only one version of this model, created over 1 year ago by Javinel Servano.
Attached files
No files