# Physics

As a way to engage students in computational thinking while they learn physics concepts, we created interactive computer simulations on the topics of vectors, motion, energy, and momentum. These simulations were written in the programming language VPython, which is specifically for creating 3D graphics, and the code for each simulation is visible next to the simulation itself. This allows students to explore and even modify the code behind the simulations, giving physics teachers the opportunity to incorporate computer programming into their curricula.
As an introduction to vectors, our map simulation allows students to upload a map of their choosing and then draw vectors on that map as a way to plan a trip. Accompanying the simulation is an exercise for students. As part of this exercise, students explore and make modifications to the simulation’s code. Because the map in the simulation is customizable, the exercise can be made relevant to a diverse group of students.
Teacher Resources
We created a simulation that allows students to draw vectors on a set of axes by clicking and dragging. Displayed alongside each vector are its components. This simulation is used as part of an exercise that introduces students to the programming concepts of functions and for-loops. The ultimate goal of the exercise is for each student to write a short function that uses a for-loop to calculate the sum, or resultant, of all the vectors that he/she has drawn. After this function is integrated into the simulation’s code, the simulation automatically displays the resultant vector after a student draws at least two vectors. The teacher version of the simulation contains the code missing from the student version.
Teacher Resources
Our numerical vector simulation uses integer input to create a vector. The user inputs the desired angle and magnitude, and then the corresponding vector is displayed on a set of axes along with text conveying the vector’s angle, magnitude, x-component, and y-component.
We created two simulations of a free-falling ball: one simulation without air resistance and one simulation with air resistance. Both simulations allow the user to manipulate the ball’s radius, mass, and height above the ground, as well as the density of the fluid through which the ball falls. Each simulation also includes a bar graph that displays the ball’s potential energy and kinetic energy. The bar graph changes as the ball falls. In the simulation with air resistance, the bar graph also shows the cumulative external work. Accompanying the simulations is a two-part exercise that guides students through experiments using first the simulation without air resistance and then the simulation with air resistance as a way to increase their understanding of free fall, air resistance, and energy.
Teacher Resources
• Free Fall Exercise Part 1 – PDF / DOCX
• Free Fall Exercise Part 2 – PDF / DOCX
Our ramp simulation shows an object moving down an inclined plane. The user can choose among a ball, a disc, and a hoop and can input the radius and mass of whichever object he/she selects. The user can also change the length and angle of the ramp and turn friction on or off. If friction is activated, the object rolls down the ramp without slipping. A bar graph displays the object’s potential energy, translational kinetic energy, and rotational kinetic energy. The bar graph changes as the object moves down the ramp.
Our collision simulation illustrates the collision of two objects. The user can manipulate the mass and velocity of each object and can choose between elastic collision and completely inelastic collision. A position vs. time graph displays data points for both objects.