globals [ clock ;; this is the number of ticks elapsed decays ;; # of decays during this clock tick last-count ;; this is the number of nuclei at the beginning -- ] ;; reset each time a red line is drawn on the plot to setup ca set-default-shape turtles "circle" cct number-nuclei [ setxy random-float screen-size-x random-float screen-size-y set color cyan ] set last-count number-nuclei ;; remember the starting number of nuclei set clock 0 set decays 0 setup-plots update-plots end to go ;; if all the nuclei have decayed then stop the model if not any? turtles with [color = cyan] [ stop ] set decays 0 ask turtles with [color = cyan] [ if (random-float 100.0 < decay-chance) [ decay set decays decays + 1] ] set clock clock + 1 update-plots end ;; this displays the decaying particle to decay if flash-decays? [ set color yellow wait 0.1 ] set color blue end to setup-plots set-current-plot "Radioactive Nuclei" set-plot-y-range 0 number-nuclei set-current-plot "Decay Rate" set-plot-y-range 0 ceiling (number-nuclei / 100) end to update-plots locals [undecayed] set undecayed count turtles with [color = cyan] ;; when half of the original nuclei have decayed draw a line to mark the half-life set-current-plot "Radioactive Nuclei" if (last-count / 2) > undecayed [ set-current-plot-pen "lines" draw-vertical-line clock draw-horizontal-line undecayed set last-count undecayed ] set-current-plot-pen "default" plot undecayed if clock > 0 [ set-current-plot "Decay Rate" plot decays ] end ;; this draws a line at the given x-coordinate to draw-vertical-line [x-val] set-plot-pen-color red plot-pen-up plotxy x-val 0 plot-pen-down plotxy x-val number-nuclei end ;; this draws a line at the given y-coordinate to draw-horizontal-line [y-val] set-plot-pen-color green plot-pen-up plotxy 0 y-val plot-pen-down plotxy clock y-val end ; *** NetLogo Model Copyright Notice *** ; ; This model was created as part of the project: CONNECTED MATHEMATICS: ; MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL ; MODELS (OBPML). The project gratefully acknowledges the support of the ; National Science Foundation (Applications of Advanced Technologies ; Program) -- grant numbers RED #9552950 and REC #9632612. ; ; Copyright 1999 by Uri Wilensky. All rights reserved. ; ; Permission to use, modify or redistribute this model is hereby granted, ; provided that both of the following requirements are followed: ; a) this copyright notice is included. ; b) this model will not be redistributed for profit without permission ; from Uri Wilensky. ; Contact Uri Wilensky for appropriate licenses for redistribution for ; profit. ; ; This model was converted to NetLogo as part of the project: ; PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN ; CLASSROOMS. The project gratefully acknowledges the support of the ; National Science Foundation (REPP program) -- grant number REC #9814682. ; Converted from StarLogoT to NetLogo, 2001. Updated 2003. ; ; To refer to this model in academic publications, please use: ; Wilensky, U. (1999). NetLogo Decay model. ; http://ccl.northwestern.edu/netlogo/models/Decay. ; Center for Connected Learning and Computer-Based Modeling, ; Northwestern University, Evanston, IL. ; ; In other publications, please use: ; Copyright 1998 by Uri Wilensky. All rights reserved. See ; http://ccl.northwestern.edu/netlogo/models/Decay ; for terms of use. ; ; *** End of NetLogo Model Copyright Notice *** @#$#@#$#@ GRAPHICS-WINDOW 248 10 582 365 40 40 4.0 1 10 1 1 1 CC-WINDOW 248 369 573 528 Command Center MONITOR 6 183 78 232 clock clock 0 1 MONITOR 172 183 246 232 decays decays 0 1 MONITOR 89 183 160 232 nuclei count turtles with\n[color = cyan] 0 1 SLIDER 5 92 245 125 decay-chance decay-chance 0.0 100.0 3.0 0.05 1 % SLIDER 5 58 245 91 number-nuclei number-nuclei 1 4000 1500 1 1 NIL BUTTON 55 10 124 43 setup setup NIL 1 T OBSERVER T BUTTON 135 10 200 43 go go T 1 T OBSERVER T PLOT 5 235 246 385 Radioactive Nuclei time number 0.0 20.0 0.0 1000.0 true false PENS "default" 1.0 0 -16776961 true "lines" 1.0 0 -65536 true PLOT 5 386 246 528 Decay Rate time number 0.0 20.0 0.0 10.0 true false PENS "default" 1.0 0 -65536 true SWITCH 62 133 204 166 flash-decays? flash-decays? 0 1 -1000 @#$#@#$#@ WHAT IS IT? ------------ This model simulates the spontaneous decay of a collection of radioactive nuclei. As they decay and become stable, the plot of the number that are still radioactive demonstrates the notion of "half-life". HOW IT WORKS ------------ At each time tick, each undecayed (light blue) nucleus has a certain chance of decaying. When a nucleus decays, it briefly flashes bright yellow (as if giving off radiation), then turns dark blue. Eventually, if you wait long enough, all of the nuclei will have decayed and the model will stop. HOW TO USE IT ------------- Set the initial number of nuclei (NUMBER-NUCLEI slider) and the likelihood of decay during each time interval (DECAY-CHANCE slider). Then push the SETUP button. Push the GO button to run the model. The number of radioactive nuclei that remain is shown in the "Radioactive Nuclei" plot. Each time the number of nuclei is reduced by half, red and green lines appear on the plot to mark the place where each halfway mark was reached. The "Decay Rate" plot shows the number of decays that occur during each clock tick. If you turn off the FLASH-DECAYS? switch, the decaying particles won't flash yellow, and the model will run faster. THINGS TO NOTICE ---------------- What is the shape of the decay curve (Radioactive Nuclei)? How is this affected by the initial conditions? Why is the decay curve this shape? Is it the same as the decay curve shown in books? The time between red lines is called the half-life. What is its physical meaning? Is it constant as the number of nuclei decreases? Is it affected by the initial number of nuclei or the decay-chance? Do you think it's a useful way to characterize a radioactive material? How long does it take for all the nuclei to decay? Watch one nucleus carefully. When will it decay? Radioactivity depends on the number of decays per unit time (Decay Rate), because each decay event gives off radiation. What happens to the radioactivity of this sample over time? What is the shape of the decay rate curve? How is it related to the shape of the decay curve? Examine the standard equation for nuclear decay: | N = No (e exp -(T/tau)) No is the initial number of nuclei, N is the number at a later time T, and tau is the "mean lifetime". Compare its behavior to what you see in this model. The corresponding equation for radiation is: | R = Ro (e exp -(T/tau)) Why are these two equations so similar? THINGS TO TRY ------------- Try the extremes of the initial conditions: many or few nuclei, high or low decay-chance. How does this affect the "jaggedness" of the decay rate plot? What does the plot do when very few nuclei are left? What instructions would you give each turtle be to make it behave like an unstable nucleus? Check the code in the Procedures tab and see if it's what you thought it should be. Carbon-14 dating involves comparing the ratio of a stable (C-12) to an unstable (C-14) nucleus. Explain that method in terms of this model. EXTENDING THE MODEL ------------------- It is often the case in nature that two nuclei with different decay rates are present in the same sample. Modify this model to have two or more types of nuclei. What happens to the radiation curve? In this model, the nuclei don't affect their neighbors when they decay -- they just disappear. Get them to emit particles that in turn cause reactions in other nuclei. See if you can model a chain reaction. (See the Reactor Top Down and Reactor X-Section models.) RELATED MODELS -------------- Reactor Top-Down, Reactor X-Section CREDITS AND REFERENCES ---------------------- To refer to this model in academic publications, please use: Wilensky, U. (1999). NetLogo Decay model. http://ccl.northwestern.edu/netlogo/models/Decay. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. In other publications, please use: Copyright 1999 by Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/Decay for terms of use. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 circle false 0 Circle -7566196 true true 35 35 230 @#$#@#$#@ NetLogo 2.0beta5 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@