Sand

Sand preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

chemistry and physics 

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 467 times • Downloaded 82 times • Run 0 times
Download the 'Sand' 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 is a model of how sand particles interact with each other. In this environment, all sand particles try to move down if any of the following four rules apply. The four rules are:

  1. If there is nothing directly beneath you, move down.
  2. If there is something beneath you and to the lower right, move down and to the left.
  3. if there is something beneath you and to your lower left, move down and to the right.
  4. If there is only something directly beneath you, move down and either left or right at random.

HOW TO USE IT

GO: Starts and stops the simulation.

SETUP: Sets up the model.

RELEASE-CHANCE: Determines the percent chance that a particle of sand will fall from a spout each turn (default value of 100%).

SPACING: Determines how long a spout waits before releasing the next particle of sand.

DUMP SAND: Dumps sand on all of the model according to the density leve. Use this only after you have pressed SETUP.

DENSITY: Sets the density of sand particles dumped in DUMP SAND (default value of 25%). For example setting the density to 40 will, at random fill 40 percent of the patches with sand.

THINGS TO NOTICE

Observe how sand will roll down a "mountain" of sand particles. Consider how this phenomenon is supported by the rules. Notice the patterns that form when two "mountains" of sand grow into each other.

THINGS TO TRY

Observe how the spouts will form uniform pyramids of sand. Try DUMP SAND at a low density once you have a relatively large pyramid shape. How does this effect the shape of the pyramid? Does the pyramid ever return to its original shape?

Try decreasing RELEASE-CHANCE. What effect does this have on the growth rate of sand "mountains"?

Set the SPACING to 1. (You'll have to edit the slider, since the normal minimum is 2.) What happens? Is this just a limitation of the model rules, or does it have some plausible physical interpretation?

EXTENDING THE MODEL

In the Code tab, notice the variable spout-space. Try changing the number of spouts at the top of the view by changing spout-space.

Does this model accurately reflect how sand behaves? If not what rules could you devise to more accurately model sand's behavior? How could they be incorporated into the model?

What effect does weight have on sand particles? Should particles with lots of particles above them behave differently? If so, how would this change the rules?

Try simulating erosion with this model. How could you simulate wind? What effect would this have on the shape of the piles? How could you simulate rain? What effect would this have on the shape of the piles?

NETLOGO FEATURES

Notice how the model stores an agentset in a variable, spout-patches. It is initialized with the agentset of the patches where the spouts are located. Subsequently this variable can be used in an ask command just like the default agentsets of turtles and patches. Since the agentset is built once, ahead of time, the models runs faster than if the agentset were rebuilt at every step.

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. (1996). NetLogo Sand model. http://ccl.northwestern.edu/netlogo/models/Sand. 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 1996 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 [
  spout-patches    ;; set in setup so we don't have to keep recomputing it
  spout-ycor       ;; location of the spouts
  surface-ycor     ;; initial location of the surface of the sand at the bottom
]

patches-own [
  next-color       ;; patches first all decide what color to change to, then all change
]

to setup
  clear-all
  set surface-ycor -0.8 * max-pycor
  ask patches with [pycor < surface-ycor]
    [ set pcolor gray ]
  set spout-ycor round (max-pycor * 0.9)
  let spout-space round (max-pxcor * 0.6)
  ;; now set up the blue spouts at spout-space intervals
  set spout-patches patches with [(pxcor mod spout-space = 0) and
                                  (pycor = spout-ycor)]
  ask spout-patches
    [ set pcolor blue ]
  reset-ticks
end 

to dump-sand
  ask patches with [(pycor < spout-ycor) and
                    (pycor > surface-ycor)]
    [ if random-float 100 < density
        [ set pcolor brown ] ]
end 

to go
  spout
  move-all-sand
  tick
end 

;; spouts sand particles depending on spacing (how often sand is released)
;; and the release-chance percent when the spacing interval is reached

to spout
  if ticks mod spacing = 0
    [ ask spout-patches with [random-float 100 <= release-chance]
        [ ask patch-at 0 -1 [ set pcolor brown ] ] ]
end 

;; implements the four rules given in the info tab
;; to all the brown sand particles

to move-all-sand
  ask patches
    [ set next-color pcolor ]
  ask patches with [pcolor = brown]
    [ ifelse ([pcolor] of patch-at 0 -1 = black)
        [ move 0 ]
        [ ifelse ([pcolor] of patch-at -1 -1 = brown) and
                 ([pcolor] of patch-at  1 -1 = black)
           [ move 1 ]
           [ ifelse ([pcolor] of patch-at -1 -1 = black) and
                    ([pcolor] of patch-at  1 -1 = brown)
              [ move -1 ]
              [ if ([pcolor] of patch-at 1 -1 = black) and
                   ([pcolor] of patch-at -1 -1 = black)
                  [ move one-of [1 -1] ] ] ] ] ]
  ;; we do this in a separate "ask" so that all the patches decide
  ;; on their new colors before any of them actually change color
  ask patches
    [ set pcolor next-color ]
end 

to move [x-offset];; patch procedure
  set next-color black
  ask patch-at x-offset -1 [ set next-color brown ]
end 


; Copyright 1996 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 Sand Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.