Wave Machine

Wave Machine preview image

2 collaborators

Uri_dolphin3 Uri Wilensky (Author)
Default-person Zack Moy (Author)

Tags

physics 

Tagged by Zack Moy over 10 years ago

waves 

Tagged by Zack Moy over 10 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.4 • Viewed 254 times • Downloaded 14 times • Run 2 times
Download the 'Wave Machine' 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 simulates wave motion in a membrane. The four edges of the membrane are fixed to a frame. A green rectangular area represents a driver plate that moves up and down, exhibiting sinusoidal motion.

HOW IT WORKS

The membrane is made up of lines of turtles. Each turtle acts as it were connected to its four neighboring turtles by springs. In this model, turtles move only up and down -- the force's direction IS only up and down. The greater the distance between a turtle and its neighbors, the stronger the force.

When the green turtles move up, they "pull up" the turtles which are their neighbors, which in turn pull up the turtles which are their neighbors, and so on. In that way, a wave moves along the membrane. When the wave reaches the edges of the membrane (the blue turtles), the wave is reflected back to the center of the membrane.

The amplitude of the green turtles is fixed regardless of the stiffness of the membrane. However, moving a stiff membrane requires a lot more force to move it the same amount as an unstiff membrane. So even as the stiffness of the membrane is increased, the wave height will remain the same because the amplitude is kept the same.

HOW TO USE IT

Controls of membrane properties:

The FRICTION slider controls the amount of friction or attenuation in the membrane. The STIFFNESS slider controls the force exerted on a turtle by a unit deflection difference between the turtle and its four neighbors.

Controls of the driving force:

The DRIVER-FREQUENCY slider controls the frequency at which the green area of the membrane (the driving force) moves up and down. The DRIVER-AMPLITUDE slider controls the maximum height of the green area of the membrane.

The DRIVER-X and DRIVER-Y sliders control the position of the driver. The DRIVER-SIZE slider controls the size of the driver.

Controls for viewing:

The THREE-D? switch controls the view point of the projection. OFF is for the top view (2-D looking down), and ON gives an isometric view, at an angle chosen with the VIEW-ANGLE slider.

THINGS TO TRY

Click the SETUP button to set up the membrane. Click GO to make the selected area of the membrane (the green turtles) begin moving up and down.

Try different membranes. Soft membranes have smaller stiffness values and hard membranes have larger stiffness values.

Try different driving forces, or try changing the frequency or amplitude. It is very interesting to change the size and the position of the driving force to see symmetrical and asymmetrical wave motions.

Try to create a "standing wave," in which some points in the membrane do not move at all.

EXTENDING THE MODEL

In this model, the movement of the turtles is only in the vertical direction, perpendicular to the membrane. Modify the model such that the movement is within the membrane plane, i.e. the x/y plane.

You can also try to add additional driving forces to make a multi-input membrane model. Another thing you can try is to apply different waveforms to the driving-force to see how the membrane reacts to different inputs. Try changing the overall shape of the driving force.

Try to build a solid model, that is, a model of waveforms within all three dimensions.

Instead of using amplitude to create the wave, change it to apply a fixed amount of force continuously.

NETLOGO FEATURES

Note the use of the turtles-on reporter to find turtles on neighboring patches.

A key step in developing this model was to create an internal coordinate system. X, Y, and Z are just three turtles-own variables. You can imagine that turtles are situated in and move around in 3-space. But to display the turtles in the view, which is two-dimensional, the turtle's three coordinates must be mapped into two.

In the 2-D view, the turtle's x and y coordinates are translated directly to NetLogo coordinates, and the z coordinate is indicated only by varying the color of the turtle using the scale-color primitive.

In the 3-D view, an isometric projection is used to translate x, y, and z (the turtle's real position) to xcor and ycor (its position in the view). In this projection, a point in the world may correspond to more than one point in the 3-dimensional coordinate system. Thus in this projection we still vary the color of the turtle according to its z position, to help the eye discriminate.

In the 3-D version, it does not make sense for the turtles to "wrap" if they reach the top or bottom of the world nor does it make sense for them to remain at the top of the world, so turtles are hidden if their computed ycor exceeds the boundaries of the world.

CREDITS AND REFERENCES

Thanks to Weiguo Yang for his help with this model.

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 Wave Machine model. http://ccl.northwestern.edu/netlogo/models/WaveMachine. 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, 2001.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  membrane-edge-x  ;; horizontal distance from center to edge of membrane
  membrane-edge-y  ;; vertical distance from center to edge of membrane
]

turtles-own [
  edge?            ;; are we on the edge of the membrane?
  driver?          ;; are we part of the green driving plate?
  x                ;; position on x axis in space
  y                ;; position on y axis in space
  z                ;; position on z axis in space
  velocity         ;; velocity along z axis
  neighbor-turtles ;; agentset of turtles adjacent to us
]

to setup
  clear-all
  set membrane-edge-x floor (max-pxcor / 2)
  set membrane-edge-y floor (max-pycor / 2)
  set-default-shape turtles "circle"
  ask patches with [(abs pxcor <= membrane-edge-x) and
                    (abs pycor <= membrane-edge-y)]
    [ sprout 1
        [ set edge? (abs xcor = membrane-edge-x) or
                    (abs ycor = membrane-edge-y)
          if edge? [ set color blue ]
          set driver? (abs (xcor - driver-x) <= driver-size) and
                      (abs (ycor - driver-y) <= driver-size)
          if driver? [ set color green ]
          set x xcor
          set y ycor
          set z 0
          set velocity 0
          recolor ] ]
  ask turtles
    [ set neighbor-turtles turtles-on neighbors4 ]
  project
  reset-ticks
end 

to recolor  ;; turtle procedure
  if not edge? and not driver?
    [ set color scale-color red z -20 20 ]
end 

to go
  ask turtles with [not driver? and not edge?]
    [ propagate ]
  ask turtles
    [ ifelse driver?
        [ set z (driver-amplitude * (sin (0.1 * driver-frequency * ticks))) ]
        [ set z (z + velocity)
          recolor ] ]
  project
  tick
end 

to propagate   ;; turtle procedure -- propagates the wave from neighboring turtles
  set velocity (velocity +
                 (stiffness * 0.01 *
                   (sum [z] of neighbor-turtles
                    - 4 * z)))
  set velocity (((1000 - friction) / 1000) * velocity)
end 

;;; procedures for displaying in 2-D or 3-D

to project
  ifelse three-d?
    [ project-3d ]
    [ project-2d ]
end 

to project-3d
  ask turtles [
    let xc (x + (cos view-angle) * y)
    let yc (z + (sin view-angle) * y)
    ifelse patch-at (xc - xcor) (yc - ycor) != nobody
    [ setxy  xc yc
      show-turtle ]
    [ hide-turtle ]
    recolor
  ]
end 

to project-2d
  ;; Set our viewable x and y coordinates to be the same as our real
  ;; coordinates.  This is only needed for if the user turns THREE-D?
  ;; off while the model is running.
  ask turtles
    [ setxy x y
      recolor
      show-turtle ]
end 


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

There are 12 versions of this model.

Uploaded by When Description Download
Uri Wilensky about 6 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky over 6 years ago Updated version tag Download this version
Uri Wilensky over 6 years ago Updated to version from NetLogo 5.0.3 distribution Download this version
Uri Wilensky over 7 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky almost 9 years ago Model from NetLogo distribution Download this version
Uri Wilensky almost 9 years ago Wave Machine Download this version
Zack Moy almost 9 years ago "new" version Download this version
Zack Moy almost 9 years ago "new" version Download this version

Attached files

File Type Description Last updated
Wave Machine.png preview Preview for 'Wave Machine' about 6 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.