NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo Models Library:
Curricular Models/PNoM

(back to the library)

PNoM 2 Diffusion Sensor Sandbox

[screen shot]

If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web

WHAT IS IT?

This model enables students to draw a model to "sketch" representations of new systems to explore concepts related to gas behavior and gas particles. In addition, it enables students to create sensors by writing simple NetLogo code and use these sensors to collect data from their models. A wide range of real world systems can be modeled with this simple interface (e.g. diffusion of perfume from an uncapped container, hot gas mixed with a cold gas, mixtures of gases).

This model is part of the Particulate Nature of Matter (PNoM) Curricular Unit. Most of the models in PNoM use the same basic rules for simulating the behavior of gases. Each model highlights different features of how gas behavior is related to gas particle behavior and adds new features to the model.

In all of the models, gas particles are assumed to move and to collide, both with each other and with objects such as walls.

In this model, particles can be added, color coded, and sped up or slowed down, by drawing with the mouse cursor in the WORLD & VIEW and selecting the appropriate MOUSE-INTERACTION. Also, additional types of removable and replaceable walls can be added to the WORLD.

HOW IT WORKS

The particles are modeled as hard balls with no internal energy except that which is due to their motion. Collisions between particles are elastic. The total kinetic energy of the two particles after the encounter is equal to their total kinetic energy before the encounter. When a particle hits the wall, it bounces off the wall and neither gains energy from nor loses energy to the wall.

The exact way two particles collide is as follows: 1. A particle moves in a straight line without changing its speed, unless it collides with another particle or bounces off the wall. 2. Two particles "collide" if they find themselves on the same patch. In this model, two turtles are aimed so that they will collide at the origin. 3. An angle of collision for the particles is chosen, as if they were two solid balls that hit, and this angle describes the direction of the line connecting their centers. 4. The particles exchange momentum and energy only along this line, conforming to the conservation of momentum and energy for elastic collisions. 5. Each particle is assigned its new speed, heading and energy.

HOW TO USE IT

Buttons

SETUP - sets up the initial conditions set on the sliders. GO/STOP/ADD ELEMENTS - runs and stops the model. This button must be pressed in order to interact with the model. REMOVE/REPLACE RED WALL - Toggles the red walls on and off. REMOVE/REPLACE BLUE WALL - Toggles the blue walls on and off. RESET TICK COUNTER - Resets the tick counter to zero. SAVE - Saves the current state of the world to a file the user specifies. LOAD - Loads a previously saved world from a file the user specifies.

Sliders

INITIAL-#-PARTICLES - sets the number of gas particles in the box when the simulation starts. INITIAL-GAS-TEMPERATURE - sets the initial temperature of the gas. WINDOW-WIDTH - sets the width of the plots in terms of ticks (x-axis).

Switches

SHOW-WALL-HITS? - turn visualization off when particles hits the walls (as flashes) on or off. UNIFORM-Y-SCALES? - make all four plots have the same scale maximum Y coordinate value and scale accordingly.

Choosers

VISUALIZE-PARTICLE-SPEED? allows you to visualize particle speeds. For example, selecting "arrows", creates a representation of each particle velocity using a scalar arrow. Selecting "shades" creates representation of each particle speed using a brighter (faster) or darker (slower) shade of the particle's color.

MOUSE-INTERACTION sets the type interaction the user can do with the mouse in the WORLD & VIEW.

Possible settings include: "draw basic wall" - adds a gray wall under the mouse cursor. "draw red removable wall" - adds a red wall under the mouse cursor which can be alternatively removed and replaced using the REMOVE/REPLACE RED WALL. "draw green removable wall" - adds a green wall under the mouse cursor which can be alternatively removed and replaced using the REMOVE/REPLACE GREEN WALL. "big eraser" - erases all objects (except the yellow box boundary walls) under the mouse cursor. "slow down particles" - increase the current speed of the particles by 10%. "speed up particles" - reduces the current speed of the particles by 10%. "paint particles green" - recolors the particles under the mouse cursor green (other settings include orange and purple). "add green particles" - adds a couple of new particles under the mouse cursor (other settings include orange and purple).

WATCH-AND-TRACE-A-PARTICLE - highlights a particle and puts its pendown. RIDE-A-PARTICLE - attaches the viewpoint of the observer to a particle. RESET-PERSPECTIVE used for re-centering the WORLD & VIEW after riding or watching a particle.

Code Inputs

CODE 1 - the code that corresponds to the algorithm of "sensor 1". EXAMPLE 1 - an example code for the "sensor 1". In case you would like to start over, you can copy this code to CODE 1 input box.

CODE 2 - the code that corresponds to the algorithm of "sensor 2". EXAMPLE 2 - an example code for the "sensor 2". In case you would like to start over, you can copy this code to CODE 2 input box.

CODE 3 - the code that corresponds to the algorithm of "sensor 3". EXAMPLE 3 - an example code for the "sensor 3". In case you would like to start over, you can copy this code to CODE 3 input box.

CODE 4 - the code that corresponds to the algorithm of "sensor 4". EXAMPLE 4 - an example code for the "sensor 4". In case you would like to start over, you can copy this code to CODE 4 input box.

THINGS TO NOTICE

The mouse interaction can be used while the model is running as well as when it is stopped.

THINGS TO TRY

Create a model of how odors move throughout a room. Why do some people smell the odor before others? Does the layout of furniture, large objects, and walls in the room effect the movement of the odor? How about the temperature of the air in the room?

Create a model of diffusion of a perfume from a closed container. How would you represent the different gases (the perfume and the surrounding air)? What shape will the container be? How will you model a removable cap or lid?

Create a model of room filled with cold air and a different room filled with warm air. How will represent these different rooms of air? What could you add to show what happens when they mix?

Create a model of heat transfer that shows what happens to the energy of one very fast moving gas particle when it hits a bunch of very slow moving gas particles. What does this show happening to the energy of the initial gas particles?

RELATED MODELS

  • GasLab models
  • Connected Chemistry models

HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

To cite the Particulate Nature of Matter curriculum as a whole, please use:

  • Novak, M., Brady, C., Holbert, N., Soylu, F. and Wilensky, U. (2010). Particulate Nature of Matter curriculum. http://ccl.northwestern.edu/curriculum/pnom/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. Thanks to Umit Aslan and Mitchell Estberg for updating these models for inclusion the in Models Library.

COPYRIGHT AND LICENSE

Copyright 2010 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 https://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.

(back to the NetLogo Models Library)