Kepler Light Curve
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
turtles-own [ vx ;; x-component of velocity vector xc ;; real x-coordinate (in case particle leaves world) yc ;; real y-coordinate (in case particle leaves world) ] globals [ period flux max-flux scaler g ;; Gravitational Constant ] ;;;;;;;;;;;;;;;;;;;;;;;; ;;; Setup Procedures ;;; ;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all set scaler scale setup-patches set max-flux count patches with [pcolor = yellow] set-default-shape turtles "circle" set period 1000000 reset-ticks end to setup-patches ask patches[set pcolor black] ask patches with [(sqrt((pxcor * pxcor) + (pycor * pycor)) < 200)][set pcolor yellow] end ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Runtime Procedures ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; to go if ((ticks mod period) = 0) [ reset-ticks instance-planet ] ask turtles [ update-position ] calculate-flux check-position tick end to instance-planet clear-turtles crt 1 [ set period round (1000 / scaler * sqrt(orbit-distance * orbit-distance * orbit-distance)) set xc -300 set yc 0 set color black set size (200 * (planet-radius / (100 - orbit-distance))) setxy xc yc set vx (sqrt ((0.593) / orbit-distance)) * scaler ] set-plot-x-range (0) (5 * period) end to update-position ;; Turtle Procedure ;; As our system is closed, we can safely recenter the center of mass to the origin. set xc (xc + vx) adjust-position end to check-position ask turtles[ if xc > max-pxcor[ die ] ] end to adjust-position ;; Turtle Procedure ;; If we're in the visible world (the world inside the view) ;; update our x and y coordinates. ;; if there is no patch at xc yc that means it is outside the world ;; and the turtle should just be hidden until it returns to the ;; viewable world. ifelse patch-at (xc - xcor) (yc - ycor) != nobody [ setxy xc yc show-turtle ] [ hide-turtle ] end to calculate-flux ask turtles[ ask patches in-radius (size / 2) [set pcolor black] ] set flux ((count patches with [pcolor = yellow]) / max-flux) ask turtles[ ask patches in-radius size[ if (sqrt((pxcor * pxcor) + (pycor * pycor)) < 200) [set pcolor yellow] ] ] ; ifelse count turtles > 0[ ; ifelse abs [xc] of turtle 0 < 200 ; [set flux (1 - ((planet-size * planet-size) / (200 * 200)))] ; [set flux 1] ; ] ; [set flux 1] end to update-patches if count turtles > 0[ ask turtles[ let x xc ask patches with [(sqrt((pxcor * pxcor) + (pycor * pycor)) < 200)][ ifelse (sqrt((pxcor - x) * (pxcor - x) + (pycor * pycor)) < [size] of turtle 0) [set pcolor black] [set pcolor yellow] ] ] ] end ; Copyright 1998 Uri Wilensky. ; See Info tab for full copyright and license.
There is only one version of this model, created almost 11 years ago by Cody Dirks.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.