ScratchData LogoScratchData
Back to cmessenger's profile

Balls And Springs

CMcmessenger•Created June 14, 2013
Balls And Springs
502
392
13032 views
View on Scratch

Instructions

Drag a ball. Watch what happens. Next, drag and hold the ball, and wait for some neighbors to be drawn to it. Now let go and watch what happens. Try "throwing" a ball, to give it some initial speed. Press "reset x" to reset the "x" dimension (horizontal). Ditto for y (vertical). Press "N = 1" to reset with one ball. Ditto for 2, 3, 5, 10, 20 and 30. Select "springs" to see where the springs are. Select "color" to make the color of the balls and springs a function of how much kinetic energy (balls) or potential energy (springs) they have (blue is low, red is high). Select "info" to see the scales of the units. Select "energy" to see a running tally of the total energy of the system. If you click it again, it will also break the total energy down into kinetic energy (in the moving balls) plus potential energy (in the stretched springs).

Description

Physics simulation of balls attached to each other with ideal springs, with no gravity or friction. The springs are invisible, and the balls are infinitely small point masses. When the balls are really off-screen, they remain half-visible, bouncing up against the closest edge. Kinetic energy of balls is calculated as 1/2 * mass * velocity^2. Potential energy of springs is calculated as 1/2 * springiness * length^2. If the simulation were perfect, the running tally of energy (click "energy" checkbox) would remain constant. That's the law of conservation of energy. If the "tick" size were infinitely small, the simulation would be perfect. However, to make the simulation practical, we want a bigger tick size (making the balls move faster on the screen). By default, I use 10 ms. Click the "info" box to see this setting (called "ms/tick") and several others. See my Standing Waves game for another variation on the same theme.

Project Details

Project ID10848308
CreatedJune 14, 2013
Last ModifiedSeptember 8, 2016
SharedJune 14, 2013
Visibilityvisible
CommentsAllowed