1A – Glider on a Horizontal Air Track

In this activity, you will model the motion of a glider on a horizontal air track. If we neglect friction then the net force on the glider will be zero and we expect it to move with constant velocity.  Initially your model will start the glider at a specific velocity to match your measurements in lab.

Begin by copying and pasting the starter code below into a new GlowScript program.  This code will draw a rectangular box named track to simulate the air track and a box named glider to simulate the glider. The track will be oriented horizontally and the glider will not move. You will make changes to cause the glider to move in a manner that is similar to your experimental measurements.

The portions of the code where you need to make changes are indicated by large comment boxes with enclosed instructions.

#
# Experiment 1 - The Momentum Principle
#  Activity 1A - Motion on a Horizontal Track with No Applied Force
#
# Model the motion of a glider on a horizontal air track

scene = canvas(title = 'Motion on Horizontal Air Track', width = 800, height = 300)

# Define a custom color for the air track
Aluminum = vector(132/255,135/255,137/255)

# Define the Air Track object as a stationary box.   
#################################################################
#                                                               #
# A. Make sure the dimensions of the air track are appropriate  #
#                                                               #
#################################################################
track = box()
track.length = 1.50
track.width  = 0.05
track.height = 0.15
track.color = Aluminum
track.texture = textures.metal
track.pos = vector(track.length/2, -track.height/2, 0)

# Define the Glider object as a rectangular box that will
# leave a trail of points behind making a motion diagram
#################################################################
#                                                               #
# B. Set the size, color, mass, and velocity of the glider      #
#                                                               #
#################################################################
glider = box(make_trail = True, trail_type = "points", trail_radius = 0.01, interval = 20)
glider.length = 0.20                        # Length of glider in meters
glider.width  = 0.05                        # Width of glider in meters
glider.height = 0.10                        # Height of glider in meters
glider.color = color.red                    # Set the glider color
glider.texture = textures.metal             # Make the glider look more realistic
glider.pos = vector(glider.length/2, 0, 0)  # Position the glider at the left edge of track
glider.m = 0.1                              # Mass of glider in kg
glider.v = vector(0,0,0)                    # Initial velocity of glider

glider.p = glider.m * glider.v              # Initial momentum of glider

# Position the center of the scene at the midpoint of the top of the Air Track
# This will allow the air track to occupy the majority of the scene.
scene.center=vector(track.length/2, 0, 0)
             
# Create a Position vs Time Graph
PositionGraph  = graph(title='Position vs Time', xtitle='Time (s)', ytitle='Position (m)', fast=False, width=800)
PositionVsTime = gcurve(color=color.blue, width=2, label='Position, x')

# Create a Momentum vs Time Graph
MomentumGraph  = graph(title='Momentum vs Time', xtitle='Time (s)', ytitle='Momentum (kg m/s)', fast=False, width=800)
MomentumVsTime = gcurve(color=color.red, width=2, label='Momentum, p_x')

# Define necessary constants
dt = 0.002          # Time step in seconds    
t  = 0              # Initial value of elapsed time

# Iterate until the glider hits the end of the air track
#################################################################
#                                                               #
# C. Adjust the loop condition to stop the loop when the        #
#     hits the end of the air track.                            #
#                                                               #
#################################################################
while(True):
    rate(500)

    #############################################################
    #                                                           #
    # Add a line to update the glider's position (glider.pos)   #
    #                                                           #
    #############################################################
    
    
    # Update the elapsed time
    t = t + dt
    
    # Append data to graphs
    PositionVsTime.plot(t, glider.pos.x)
    MomentumVsTime.plot(t, glider.p.x)