Collisions

What is it?
This project models collisions between point-like objects. Each turtle moves around the screen, at a speed based on its energy variable. When a turtle runs into a wall, its energy value changes and it bounces off the wall. When a turtle runs into another turtle, the turtles randomly combine their energies and bounce off of each other in new directions.
How to Use It

Click the SETUP button to set up the colored walls and the distribution of turtles. Click GO to start the turtles moving.
Click PD to watch the turtles draw as the move, and click PU to stop the drawing. CLEAR-PATH clears the trails which the turtles have left.
The NUMBER slider controls the number of turtles in the simulation. (If you reset the number of turtles, you will need to press GO again to stop the simulation and then click SETUP for the changes to take effect.)

Things to Notice
Watch the distribution of the energy amoung the turtles. What does this tell you about how much energy the turtle had to begin with? About the way the turtles exchange energy? What do you think would happen if there were walls to bounce off of in the middle of the screen, as well as the edges?
Explorations
The turtles don't exchange energy or bounce off of each other in a realistic way. How would you change this project to more closely model a physical situation? How do you think this change would affect the motion of the simulation? The distribution of energy among the turtles?
StarLogo Features
This project demonstrates a simple use of the "grab" command, in the "collide" procedures. Grab provides an easy way for a turtle to communicate with one or more other turtles.

We welcome your feedback and suggestions! Please send us email.