globals [ emitter-x time beeped? amplitude max-turtles plane-altitude ] breeds [ plane wave ] wave-own [ life ] to setup ca set emitter-x (screen-edge-x * (-2 / 3)) ;;Sets the initial source of sound set max-turtles 3896 set plane-altitude 0 set amplitude (screen-edge-y - (abs plane-altitude) - 4) setup-plane setup-tower end to setup-plane create-custom-plane 22 [ set color red setxy (emitter-x - 11) plane-altitude ifelse (who <= 9) [ setxy (xcor + who) (ycor + 1) ] ;;Top of Plane [ ifelse (who = 21) [ set ycor ycor + 2 ] ;;Tailfin of Plane [ set xcor (xcor + who - 10) ] ;;Bottom of Plane ] set heading 90 ] end to setup-tower locals [ tower-x tower-y ] set tower-x 0 set tower-y -22 ask patches [ if (pycor <= tower-y) [ if ((pxcor >= -1) and (pxcor <= 1) and (pycor > -30) and (pycor < -22)) ;;Tower [ set pcolor green ] if ((pxcor = tower-x) and (pycor = tower-y)) ;;Reciever [ set pcolor pink ] if (pycor = -30) ;;Surface [ set pcolor blue ] if (pycor < -30) ;;Ground [ set pcolor gray ] ] ] end to go set beeped? false set emitter-x (emitter-x + (speed / 757)) ;; Move the Sound Emitter set time (time + 1) if ( (time mod (25 - frequency)) = 0 ) [ ifelse (count turtles >= (max-turtles)) [ show "Too many turtles now..." ] [ create-custom-wave 200 [ setxy emitter-x plane-altitude ] ] ] ask plane ;; Move the Plane [ fd (speed / 757) ] ask wave ;; Move the Sound Wave [ ;if (life = 0) ;[ set xcor emitter-x ] set life (life + 1) if (life >= amplitude) ;;The sound wave eventually dies out [ die ] set color scale-color yellow (amplitude - life) 0 amplitude fd 1 if (pcolor = pink and beeped? = false) [ beep ] ] plot (count turtles-at 0 -22) end to beep set beeped? true print time 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 1998 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 2002. ; ; To refer to this model in academic publications, please use: ; Wilensky, U. (1998). NetLogo Doppler model. ; http://ccl.northwestern.edu/netlogo/models/Doppler. ; 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/Doppler ; for terms of use. ; ; *** End of NetLogo Model Copyright Notice *** @#$#@#$#@ GRAPHICS-WINDOW 237 10 489 183 60 35 2.0 0 10 1 1 1 CC-WINDOW 9 194 274 344 Command Center BUTTON 9 42 69 75 setup setup NIL 1 T OBSERVER T BUTTON 9 85 69 118 go go T 1 T OBSERVER T SLIDER 78 42 210 75 frequency frequency 1 24 20 1 1 NIL SLIDER 78 85 210 118 speed speed 0.0 1514.0 757.0 1.0 1 mph TEXTBOX 69 142 185 173 Mach 1 = 757 mph = Speed of Sound MONITOR 9 128 59 177 Mach speed / 757 3 1 PLOT 283 192 551 350 Signals Time Amplitude 0.0 150.0 0.0 3.0 true false @#$#@#$#@ WHAT IS IT? ----------- Picture this: You are waiting by the sidewalk to cross a busy street, and as a car whizzes passed you, it honks its horn. The pitch (frequency) of the horn's sound goes from a higher pitch to a lower pitch as the car passes you. This situation is an example of how relative movement between the source of a sound and a receiver affects the pitch that is heard by the receiver. When the source (the car) and the receiver (you) are moving toward each other, the receiver hears a higher pitch than the source. When the two are moving away from each other, the receiver hears a lower pitch than that of the source. This phenomenon is called the DOPPLER EFFECT. This model demonstrates the Doppler effect with a plane flying over a control tower, instead of a car and a pedestrian. As the plane flies over the control tower, it emits rings of yellow turtles, which can represent the peaks of the sound waves dispersed by the plane's engines. In this model, it may appear that the sound is being emitted in pulses or bursts, but in reality, it is a continuous emission of waves, and the rings only signify the peaks of the sound waves. The WAVELENGTH, which is the distance between each wave peak, determines what the frequency is. If the wavelength is short (peaks are close together) the frequency is high, and if it is long (peaks are far apart) then the frequency is low. HOW TO USE IT? -------------- Press the SETUP button to clear the screen and set up the plane and control tower. GO will run the program, moving the plane from left to right. The plane's speed is measured in miles per hour, and you can adjust it with the SPEED slider from 0 to 1514 mph (twice the speed of sound, or Mach 2). The MACH monitor shows the conversion of the current speed to Mach (how many times the speed of sound the plane is moving). The FREQUENCY slider controls the wavelength of the sound, which in turn controls the frequency. This slider can be thought of as controlling how often the yellow rings are emitted. The higher the frequency, the more often the rings are emitted. THINGS TO NOTICE ---------------- When the plane is stationary (plane's speed is 0), notice how the wave are equidistant on all sides of the plane. In other words, the wavelength is the same on all sides, indicating that the frequency is also the same. As you increase the speed of the plane to 400 mph, the waves begin to bunch closer together in front of the plane, and spread farther apart behind the plane. What does this show about the pitch of the sound in front and behind the plane as you increase the speed? What would the people in the control tower hear as the plane passes them? When the plane is travelling at the speed of sound (Mach 1, approximately 757mph), notice how all the sound waves overlap at one point. At this point of intersection, the constructive interference of the wave peaks creates a loud bang called a SONIC BOOM. THINGS TO TRY ------------- Adjust the SPEED and FREQUENCY sliders to observe how the relative pitch heard at the control tower fluctuates accordingly. As the plane exceeds the speed of sound, a SHOCK WAVE is produced from the constructive interference of a large number of wave peaks, and SONIC BOOMS occur along the surface of the SHOCK WAVE. If you increase the plane's speed past Mach 1 (the speed of sound) and set the frequency to 25, you can see that the shock wave resembles a geometric shape. What shape does it resemble? Anything the shock wave passes over would experience a "sonic boom", a loud bang created by the rapid increase and decrease of air pressure from the shockwave. The control tower doesn't hear anything emitted from the plane until a yellow ring passes over it. Up until then, there is silence. Try setting the plane to the maximum speed, thereby creating a shockwave, and pause the model exactly when the plane is directly above the tower. Does the control tower hear anything at this point? Now, unpause the model. What would the tower experience as soon as the shock wave hits it? EXTENDING THE MODEL -------------------- This model does not measure the relative frequency heard at the control tower. This information would be useful to show how much the pitch fluctuates as the plane passes the tower. Can you figure out a way to plot the relative frequency? In this model, only the sound source is in motion. What if you created a second plane to be the receiver? When the the two planes travel toward or away from each other, would the frequency heard by the receiver fluctuate more or less? NETLOGO FEATURES ---------------- Notice the global variables used as constants, located near the top of the procedures window, which defines the variables 'amplitude', 'tower-x' and 'tower-y'. This is a way to define constants in NetLogo, which make it easy to set aside special keywords, similar to 'screen-size-x'. These labels can represent values that you don't want procedurally redefined, but would like to quickly change in-between runs of the model. CREDITS AND REFERENCES ---------------------- To refer to this model in academic publications, please use: Wilensky, U. (1998). NetLogo Doppler model. http://ccl.northwestern.edu/netlogo/models/Doppler. 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/Doppler for terms of use. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 arrow true 0 Polygon -7566196 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box true 0 Polygon -7566196 true true 45 255 255 255 255 45 45 45 circle true 0 Circle -7566196 true true 35 35 230 person false 0 Circle -7566196 true true 155 20 63 Rectangle -7566196 true true 158 79 217 164 Polygon -7566196 true true 158 81 110 129 131 143 158 109 165 110 Polygon -7566196 true true 216 83 267 123 248 143 215 107 Polygon -7566196 true true 167 163 145 234 183 234 183 163 Polygon -7566196 true true 195 163 195 233 227 233 206 159 spacecraft true 0 Polygon -7566196 true true 150 0 180 135 255 255 225 240 150 180 75 240 45 255 120 135 thin-arrow true 0 Polygon -7566196 true true 150 0 0 150 120 150 120 293 180 293 180 150 300 150 truck-down false 0 Polygon -7566196 true true 225 30 225 270 120 270 105 210 60 180 45 30 105 60 105 30 Polygon -8716033 true false 195 75 195 120 240 120 240 75 Polygon -8716033 true false 195 225 195 180 240 180 240 225 truck-left false 0 Polygon -7566196 true true 120 135 225 135 225 210 75 210 75 165 105 165 Polygon -8716033 true false 90 210 105 225 120 210 Polygon -8716033 true false 180 210 195 225 210 210 truck-right false 0 Polygon -7566196 true true 180 135 75 135 75 210 225 210 225 165 195 165 Polygon -8716033 true false 210 210 195 225 180 210 Polygon -8716033 true false 120 210 105 225 90 210 turtle true 0 Polygon -7566196 true true 138 75 162 75 165 105 225 105 225 142 195 135 195 187 225 195 225 225 195 217 195 202 105 202 105 217 75 225 75 195 105 187 105 135 75 142 75 105 135 105 @#$#@#$#@ NetLogo 2.0beta4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@