The purpose of this model is to demonstrate what a gravity field looks like in 2D if one has several gravitating objects.

1) Click on the setup button to clear the Graphics window.

2) Push on the setup-masses forever button and click on the Graphics window.  You will see yellow ball-shaped turtles positioned at the points where you click; these turtles  correspond to the gravitating masses that create the vector field.  Use the slider called m to change the masses that you create.

3) Once you have placed all the masses you want click on the setup-field button.  As a result the setup-masses button will be stopped and the vector field will be computed and plotted as a 2D plot in the Graphics screen.

4) Once you have the vector field push on the setup-particles button to create a uniform grid of blue turtles.  The blue turtles will be attracted by the gravity centers.

5) After you have setup-particles push the run button.  You will see how the blue turtles move in the field of gravity.

NOTE: If you want to change the vector field simply press on setup-masses.  You can then move the existing masses with the mouse or place new masses by clicking on the screen.  Push on the setup-field button when you have all the masses in the right places.


Try to rewrite the code so that one or two masses move and the vector field changes with time.

Find a way to display how many particles are pulled into each mass.