Raindrops

Raindrops 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 387 times • Downloaded 69 times • Run 1 time
Download the 'Raindrops' 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 raindrops falling on the surface of a pond and the waves they produce.

HOW IT WORKS

The greater the surface tension, the slower waves travel through the water. This is implemented in the model as a weight coefficient on the difference in height between a turtle and its neighbors. The resulting weighted value is added to the turtles current vertical velocity (represented by the incremental value dz) and its current position to determine its next position. To translate the earlier statement, then, the greater the surface tension, the more a particle's neighbors can pull it towards them, thus quickening the pace of a wave through the surface.

HOW TO USE IT

SETUP initializes the model. GO continuously propagates waves in the water while listening for drops caused by the user. To release a drop, hold your mouse button down briefly on any point within the pond (the blue region). That point is where the drop will land.

The FRICTION slider controls the amount of force that pulls the water particles back towards ground level, dampening waves. SURFACE-TENSION controls how much effect the neighbors of a water particle exert on it vertically.

The IMPACT slider determines how much force a drop carries. Drops with greater impact cause larger waves.

The THREE-D switch allows you to view the pond either from above or from an angle set by ANGLE.

THINGS TO NOTICE

The pond is made up of a grid of turtles, each of whom, like in Wave Machine, behaves like it is connected to its neighbors by springs. Each turtle has a vertical position and velocity, which determine how high above the sides of the pond it is or how far below, and how much that distance will change at the next time step.

When drops are released they decrease the vertical velocity of the particles under them, causing them to move downwards. As they fall, they pull down their neighbors, who at the same time pull them up. This exchange creates a wave within the pond, centered on where the drop fell.

As the waves hit the walls, they are reflected back towards the middle, as the walls don't move up or down. Friction causes the waves to eventually decline by pulling them closer to the surface level.

THINGS TO TRY

Try creating multiple drops in the pool to see how they interact. Do they cancel each other out or reinforce each other?

Change the surface tension to see how it affects the speed of waves. Why does water with low surface tension move so slowly? What sort of liquids in real life is it similar to?

Set friction to 100 and release some drops. Do the waves ever dissipate? How can the waves rise above the sides of the pond (have positive zpos's) when only downward moving forces are exerted on them? How is a turtle's movement similar to that of a spring. Is the friction used in this model analogous to that in a spring?

EXTENDING THE MODEL

This model doesn't take into account water pressure. When part of the water is pushed down on the impact of a drop, the rest of the water should feel a push from beneath. Try adding in this mechanism.

The walls in this model don't affect waves at all. Extend the model so that the walls impose friction on waves that brush against them, causing them to dampen.

NETLOGO FEATURES

In order to create the visual impression of a wave, it is necessary for water above the sides of the pond (above water level) to appear more white, while water below to appear more blue. This was accomplished using the scale-color primitive, which takes a color to assign, a variable, and a minimum and maximum value. It works by comparing the value of the variable for each turtle to the two values, and the closer it is to the maximum, the lighter the shade of the color assigned to that turtle.

Water particles that fly off the top or bottom of the world are ignored in the model, which is done by using the commands hide-turtle (ht) and show-turtles (st). Hide turtle doesn't cause the turtle to die or change in any way, but merely stops it from being drawn. Show turtle causes it to begin being displayed again.

The model listens for raindrops using NetLogo's mouse primitives. go repeatedly calls mouse-down? to register when the user has clicked over the pond. When this condition reports true, it uses two reporters, mouse-xcor and mouse-ycor, to record the current coordinates of the mouse so that a drop can be released in the appropriate place.

RELATED MODELS

For another model that demonstrates how turtles behave as a surface, see Wave Machine. In it, turtles are connected in the same manner as outlined above, but their movement is governed by the regular sinusoidal motion of part of the surface.

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. (1998). NetLogo Raindrops model. http://ccl.northwestern.edu/netlogo/models/Raindrops. 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 1998 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

turtles-own [xpos ypos zpos delta-z neighbor-turtles]
globals [drop-width k]

to setup
  clear-all
  set-default-shape turtles "circle"
  crt (max-pxcor * max-pycor) [
    set ypos (floor (who / max-pxcor))    ;Line up the turtles according to their ID
    set xpos (who - (max-pxcor * ypos))
    set xpos (xpos - (.5 * max-pxcor))    ;Center the resulting box
    set ypos (ypos - (.5 * max-pycor))
    set xcor xpos
    set ycor ypos
    set color blue
    set zpos 0
    set delta-z 0
  ]
  ask turtles [
    set neighbor-turtles turtles-on neighbors4
  ]
  set drop-width 2
  reset-ticks
end 

to go    ;Listen for mouse clicks that indicating drops, while propagating waves
  if (mouse-down?)
    [ask turtles [release-drop mouse-xcor mouse-ycor]]
  ask turtles [compute-delta-z]
  ask turtles [update-position-and-color]
  tick
end 

to release-drop    [drop-xpos drop-ypos]    ;Turtle procedure for releasing a drop onto the pond
  if (((xpos - drop-xpos) ^ 2) + ((ypos - drop-ypos) ^ 2) <= ((.5 * drop-width) ^ 2))
      [set delta-z (delta-z + (k * ((sum [zpos] of neighbor-turtles) -
                    ((count neighbor-turtles) * zpos) - impact)))]
end 

to compute-delta-z    ;Turtle procedure
  set k (1 - (.01 * surface-tension))        ;k determines the degree to which neighbor-turtles'
  set delta-z (delta-z + (k * ((sum [zpos] of neighbor-turtles) - ((count neighbor-turtles) * zpos))))
end 

to update-position-and-color  ;Turtle procedure
  set zpos ((zpos + delta-z) * (.01 * friction))    ;Steal energy by pulling the turtle closer
  set color scale-color blue zpos -40 40            ;to ground level
  ifelse three-D?
   [
     let y (zpos + (ypos * sin angle))
     let x (xpos + (ypos * cos angle))
     ifelse patch-at (x - xcor) (y - ycor) != nobody
      [ setxy x y st ]
      [ ht ]]
   [
     ifelse patch-at (xpos - xcor) (ypos - ycor) != nobody
      [ setxy xpos ypos
      st ]
      [ ht ]]
end 


; Copyright 1998 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 Raindrops Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.