Random Balls

Random Balls preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

chemistry and physics 

Tagged by Reuven M. Lerner over 11 years ago

mechanics 

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 383 times • Downloaded 85 times • Run 1 time
Download the 'Random Balls' 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?

Random Balls simulates a frictionless billiard table.

HOW IT WORKS

The balls are drawn in green. They move in straight lines and bounce off the walls but not off of each other. The center of mass is drawn in white and leaves a red trail.

HOW TO USE IT

Select the number of balls to be used, then push SETUP. Push GO to run the model.

THINGS TO NOTICE

Watch how the center of mass moves for a while. Is there a pattern? Is there a region in the box that it stays within?

THINGS TO TRY

Use the speed slider to watch the model in slow motion. Also try fast forwarding it.

Run the model with a lot of turtles. What happens to the motion of the center of mass? Why? Now run it with only a handful of turtles. (Try it in slow motion.) Now what happens and why?

Let the model run for a while. What do you notice about how much time the center of mass spends at different distances from the origin (its frequency distribution)?

Push SETUP, then in the command center, enter:

ask balls [ set heading 60 ]

This points all of the turtles in the same direction. What does the center of mass do now? Try other headings.

EXTENDING THE MODEL

Presently the balls don't bounce off each other. If they did, would it make a difference in the behavior of the center of mass? Try it.

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 Random Balls model. http://ccl.northwestern.edu/netlogo/models/RandomBalls. 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

breed [balls ball]
breed [centers center]

to setup
  clear-all
  ;; make green balls
  set-default-shape turtles "circle"
  create-balls number
    [ set color green
      setxy random-xcor random-ycor ]
  ;; make white center of mass
  create-centers 1
    [ set size 2
      move-center
      pen-down ]
  reset-ticks
end 

to go
  ask balls [ bounce  fd 1 ]
  ask centers [ move-center ]
  tick
end 

to move-center  ;; center procedure
  ;; we want a white ball that leaves a red trace, so we need
  ;; to temporarily turn the ball red as we move it
  set color red
  setxy mean [xcor] of balls
        mean [ycor] of balls
  set color white
end 

to bounce  ;; balls procedure
  ;; bounce off left and right walls
  if abs pxcor = max-pxcor
    [ set heading (- heading) ]
  ;; bounce off top and bottom walls
  if abs pycor = max-pycor
    [ set heading (180 - heading) ]
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 Random Balls Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.