Doppler

Doppler preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

chemistry and physics 

Tagged by Reuven M. Lerner over 11 years ago

waves 

Tagged by Reuven M. Lerner over 11 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 469 times • Downloaded 87 times • Run 0 times
Download the 'Doppler' modelDownload this modelEmbed this model

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


WHAT IS IT?

This model demonstrates the Doppler effect, the apparent change in the frequency of a wave emitted by a source moving relative to an observer.

When the source of a wave moves towards you, the perceived frequency of the wave increases; when the source moves away from you, the perceived frequency decreases. This phenomena can be observed when a car passes you while the driver honks his horn. The pitch of the sound you hear is higher as the car approaches you and lower when the car is moving away.

In this model, a plane flies above an observer. Yellow circles represent the peaks of sound waves emitted by the plane.

HOW TO USE IT

Press the SETUP button to create a plane and a person. Press GO to start the plane moving. Adjust the PLANE-SPEED slider to control the speed of the plane.
There is also a convenient button that sets the plane speed to exactly the speed of sound. The SHOW-AMPLITUDES? switch lets you see the strength of the sound wave on each patch of air.

THINGS TO NOTICE

Set the speed to zero. When the plane is not moving, the wavelength (the distance between the peaks of each wave) is the same on both sides of the plane. As you increase the speed of the plane, the waves bunch together in front of the plane and spread apart behind the plane. So when the plane is moving towards the person, the wavelength is shorter, so the perceived frequency of the sound is higher. When the plane is moving away from the person, the wavelength is longer, so the perceived frequency of the sound is lower.

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

Set the plane speed to the speed of sound, 757 miles per hour (Mach 1). Notice that the peaks of the sound waves in front of the plane bunch up completely. Look at the SIGNAL plot when the plane passes the person at the speed of sound? When happens to the perceived amplitude of the sound heard by the person? This phenomena results from a shock wave -- the constructive interference of a large number of wave peaks -- and creates a very loud sound called a sonic boom.

Turn on the SHOW-AMPLITUDES? switch and adjust the plane speed to watch the constructive interference in action as the plane speed approaches Mach 1.

Increase the plane speed beyond the speed of sound. What happens to the shape of the shock wave? What does the person hear?

EXTENDING THE MODEL

Add a second plot that displays the relative frequency heard by the person. Improve the first plot to interpolate the signal data and display the amplitude between signal peaks.

In this model, only the plane is in motion. Add controls to move the person as well.

Use the NetLogo extensions API to write a Java extension that plays a sound at a given amplitude and frequency. Have the person generate the sound he hears so you can listen to the Doppler effect in action.

NETLOGO FEATURES

This model is a vertical cylinder, the plane, moving in the x direction wraps around the world, but the sound waves exit the system when they reach the top or the bottom of the world.

The listener stands at the origin, which is off-center.

HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

  • Wilensky, U. (1997). NetLogo Doppler model. http://ccl.northwestern.edu/netlogo/models/Doppler. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
  • Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.

COPYRIGHT AND LICENSE

Copyright 1997 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

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.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2004.

Comments and Questions

Click to Run Model

breed [ planes plane ]
breed [ listeners listener ]
breed [ wave-components wave-component ]

wave-components-own [
  amplitude
  wave-id ;; the wave-id identifies which wave this
          ;; component is a part of
]

listeners-own [
  wave-ids-heard ;; which wave-ids the listener just heard
                 ;; computed to avoid double-counting
]

globals [
  speed-of-sound  ;; constant
  next-wave-id ;; counters
  wave-interval ;; how many ticks between each wave?
  initial-wave-amplitude
]

to setup
  clear-all
  set-default-shape wave-components "wave particle"
  set-default-shape planes "airplane"
  set-default-shape listeners "person"

  set speed-of-sound 757
  set initial-wave-amplitude 20 ; how loud is the wave when first emitted?
  set wave-interval 3           ; how often does the plane emit a wave?

  ;; initialize a counter
  set next-wave-id 0

  ;; create the airplane
  create-planes 1 [
    set heading 90
    set ycor 3 + min-pycor
    set xcor 14 + min-pxcor
    set size 4
    set color white
  ]

  ;; create the listener
  create-listeners 1 [
    set size 3
    set color blue
  ]

  reset-ticks
end 

to go
  ; we use "fd 0.5" as speed-of-sound movement rate, instead of "fd 1",
  ; because it results in smoother animation of the wave-components.
  ask planes [ fd 0.5 * plane-speed / speed-of-sound ]      ;; move the plane
  if ticks mod wave-interval = 0 [ ask planes [ emit-wave ] ] ;; emit the sound wave

  ;; move waves
  ask wave-components [
    if not can-move? 0.5 [ die ]
    fd 0.5
    set amplitude amplitude - 0.5
    set color scale-color yellow amplitude 0 initial-wave-amplitude
    if amplitude < 0.5 [ die ]
  ]

  ;; listen and plot
  ask listeners [
    let amp amplitude-here wave-ids-heard
    plotxy ticks amp
    plotxy (ticks + 0.5) 0
    set wave-ids-heard
      remove-duplicates
        [ wave-id ] of wave-components-here
  ]

  ;; draw
  ifelse show-amplitudes? [
    ;; hide the wave and show total amplitude on each patch
    ask wave-components [ ht ]
    ask patches [
      let amp amplitude-here []
      ifelse amp > 0
        [ set plabel amp ]
        [ set plabel "" ]
      set pcolor scale-color green amp 0 60
      set plabel-color black
    ]
  ] [
    ;; show the wave and paint patches black
    ask wave-components [ st ]
    ask patches
    [
       set pcolor black
       set plabel ""
    ]
  ]
  tick
end 


;; patch procedure
;; counts the total amplitude of the waves on this patch,
;; making sure not to count two components of the same wave.

to-report amplitude-here [ids-to-exclude]
  let total-amplitude 0
  let components wave-components-here
  if count components > 0 [
    ;; get list of the wave-ids with components on this patch
    let wave-ids-here remove-duplicates [ wave-id ] of components
    foreach ids-to-exclude [ set wave-ids-here remove ? wave-ids-here ]

    ;; for each wave id, sum the maximum amplitude here
    foreach wave-ids-here [ set total-amplitude total-amplitude +
        [amplitude] of max-one-of components with [ wave-id = ? ]
          [ amplitude ]
    ]
  ]
  report total-amplitude
end 

;; plane procedure

to emit-wave
  let j 0
  let num-wave-components 180.0 ;; number of components in each wave
  hatch-wave-components num-wave-components [
    set color yellow
    set size 1
    set j j + 1
    set amplitude initial-wave-amplitude
    set wave-id next-wave-id
    set heading j * ( 360.0 / num-wave-components )
    if show-amplitudes? [ ht ]
  ]
  set next-wave-id next-wave-id + 1
end 

;; reports the plane speed in Mach, or
;; number of times the speed of sound

to-report mach
  report plane-speed / speed-of-sound
end 


; Copyright 1997 Uri Wilensky.
; See Info tab for full copyright and license.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 11 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky about 12 years ago Updated version tag Download this version
Uri Wilensky about 12 years ago Updated to version from NetLogo 5.0.3 distribution Download this version
Uri Wilensky almost 13 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 14 years ago Doppler Download this version

Attached files

File Type Description Last updated
Doppler.png preview Preview for 'Doppler' over 11 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.