Ball on a Ramp

Activity Information

Learning Goals

  • Analyze data to support the claim that Newton’s second law of motion describes the mathematical relationship among the net force on a macroscopic object, its mass, and its acceleration ( HS-PS2-1)
    • Students will develop and use models to verify mathematical computations
    • Use mathematics and computational thinking to quantify variables (velocity, acceleration, force, mass, gravity)
  • Use mathematical representations to support the claim that the total momentum of a system of objects is conserved when there is no net force on the system ( HS-PS2-2)
  • Developing and using models, communicating information, asking questions, defining problems and solutions

Prior Knowledge Required

  • Kinematic formulae
    • speed, velocity, acceleration
  • Basic coding commands and coding logic
  • Force of gravity (constant acceleration)

Code Manipulation

  • Manipulating variables and code
  • Generating code based on physics knowledge
  • While loops

Activity

Handout – Ball on a Ramp

Provided below is some code that is supposed to model the behavior of a ball rolling down an inclined plane. Run the code.

Exploration Instructions

Find the variables below and record their abbreviations. Change them, one at a time, to see how they impact the code performance. Discuss what changes and what remains consistent:

  • Ramp length
  • Ball speed
  • Time interval
  • Number of books in the stack
  • Acceleration

Reset variables to the following:

  • Ramp length = 100
  • Time interval = 10
  • Number of books in the stack = 1
  • Acceleration = 0

Now run this code. Describe the motion of the ball. Does this represent real world physics? Why or why not? What would need to change?

Coding Instructions
  1. Make the ball follow the ramp instead of straight across the screen
    1. (Hint: see what code makes the ball move to the right to help determine how to make the ball move up or down)
  2. Add code to make the ball stop at the end of the ramp regardless of the angle or height of the ramp
  3. Use the data given to your group to calculate the acceleration for your ramp. Change the acceleration in the code to match this value
    1. (Note: different values may be provided to different students/groups, but for the sake of consistency, we will use the following values:)
      • Ramp length = 100
      • Ball speed = 1
      • Time interval = 100
      • Number of books in the stack = 8
  4. If necessary, change the code to make the motion of the ball to reflect the true motion of a ball held at the top of a ramp and let go from an initial velocity of zero
Evaluation Questions
  1. How did increasing the height of the ramp (by adding more books) change the final speed of the ball? Explain.
  2. How could increasing the length of the ramp (but keeping the height the same) impact the speed of the ball? Explain.
  3. Does your simulation truly represent the change in speed of a ball rolling down a ramp? Why or why not?
  4. What could be changed about the ramp itself (besides its height or length) in the real world to make the ball either have more or less speed at the bottom of the ramp? Explain.
  5. How could you change your code to reflect of of the changes listed in the previous question?
  6. What calculations did you need to do to determine the stop point for the ball?
  7. In the following code, “pos” tells us position. What does “axis” tell us?
ramp1 = cylinder(pos = vector(R1s, R1h, 0), axis = vec(R1X, -R1Y, 0), radius = Bh, color = color.white)

Code

Link – click “remix” to edit and view the code properly

GlowScript 2.7 VPython
 
# Window setup########################
scene.width = 800 #The width of your view window
scene.height = 400 #The height of your view window
 
######################################
 
# Parameters and Initial Conditions###
BaR = 10 #Radius of the ball
BaS = 1 #Scalar to change ball speed
Bh = 5 #Height of books in first stack of books
Bw = 30 #Width of books in first stack of books
Bs = -100 #X-value offset of the center of the first book stack
Tt = 0 #reference point for drawing the books (not used in any real math)
Bc = 1 #condition for beginning to draw books (checked against time)
R1L = 100 #Length of first ramp
nB = 5 #The number of books in the first stack
A1 = 0 #Acceleration of ramp 1
#########################################
 
# Time and time step#####################
t = 0 #start time (this command sets the counter to 0)
tFinal = 200 #The end number on the counter to stop actions
#########################################
 
#Ramp and speed calculations#############
R1Y = Bh*nB #Starting Y-value coordinate for ramp (total Y value of ramp)
R1X = sqrt(R1L**2 - R1Y**2) #Starting X-value coordinate for ramp (total X value of ramp)
S1x = R1X/R1L*BaS #the horizontal vector of movement down first ramp
S1y = R1Y/R1L*BaS #the vertical vector of movement down first ramp
#########################################
 
#Drawing initial objects#################
#draw tabletop
Table= box(pos = vector(75,-6,0), size = vector(400, 10, 30), color = color.orange)
 
#Stack of books
Bc = Tt
while t<nB:
    Bc = Tt + Bh*t +Bh/2
    book = cylinder(pos = vector(Bs, Bc, 0), axis = vec(Bw, 0, 0), radius = Bh, color = color.yellow)
    t=t+1
ballstopx = Bs - Bw/2 - R1L/2
t=t+1
 
#Downward Ramp
R1h = Tt + Bh*t +Bh/2
R1s = Bs + Bw
ramp1 = cylinder(pos = vector(R1s, R1h, 0), axis = vec(R1X, -R1Y, 0), radius = Bh, color = color.white)
 
#Ball
BaX = R1s + BaR/2 
BaY = R1h+Bh + BaR/2
ball =  sphere(pos=vec(BaX,BaY,0), radius = BaR/2, color=color.red)
##########################################
 
#MOVEMENT COMMANDS LOCATED BELOW###############################################################################
 
 
#Command for ball rolling down first ramp################################################### 
 
scene.camera.follow(ball) #this makes the camera follow the ball
t=0 #resets the time counter to 0 at the start of the loop
 
theta = acos(R1X/R1L) #this calculates angle of the ramp
A1x = sin(theta)*cos(theta) #calculates x-value of acceleration
A1y = sin(theta)*sin(theta) #calculates y-value of acceleration
 
while t<tFinal: #sets the condition for this command taking place
    rate(20) #how many times per cycle the action will take place
    ball.pos.x = ball.pos.x + S1x #updates the x position of the ball at rate listed above every sec
 
    t=t+1 #makes it so ever cycle it adds 1 to the time counter
 
#    if ???: #sets condition for when the ball should stop moving 
#    t=tFinal #sets the timer to the final value, so the loop stops 

Answer Key

Handout

Evaluation Questions
  1. Increasing the height of the ramp did not affect the final speed of the ball.
  2. Increasing the length of the ramp increased the final speed of the ball.
  3. The simulation is not realistic; When a ball rolls down a ramp, it is moved due to the force of gravity; however, it cannot fall straight down since it is restricted by the ramp. On a completely horizontal surface, gravity and the normal force perfectly balance each other out, and there is no acceleration. As the ramp becomes steeper, the less the force of gravity is resisted by the normal force. For a completely vertical surface, there will be no normal force and therefore the force of gravity pulls the ball towards the earth unimpeded. This means that increasing the ramp height should increase the speed of the ball. Additionally, changing the length of the ramp should not affect the final speed of the ball. Although a ball rolling down a steeper ramp will accelerate faster, the final speed of the ball at the end of the ramp will be the same, regardless of ramp length (ignoring frictional forces). This can be demonstrated by relating the potential and kinetic energy. We can set potential energy equation equal to the kinetic energy equation to find the speed of the ball is affected by the ramp:

    mgh=(1/2)mv^2

where m is mass of the ball, g is the acceleration of gravity, h is the height of the ramp, and v is the speed of the ball. Since the mass, force of gravity, and height of the ramp does not change when you lengthen the ramp, the velocity will be the same.

  1. Adding a coefficient of friction could reduce the speed of the ball. This is because frictional forces resist motion.
  2. See highlighted code below. Note that some values are in slightly different locations in the code below.
  3. “axis” tells us the direction that the ramp will point. In this instance, the ramp will be “R1X” units in the x-direction and “-R1Y” units in the y-direction

Code

Partially Complete

Link – click “remix” to edit and view the code properly

GlowScript 2.7 VPython
 
# Window setup############################################################################
scene.width = 800 #how far the view extends along the X-axis initially
scene.height = 600 #how tall the view extends on the Y-axis initially
 
##########################################################################################
 
 
# Parameters and Initial Conditions#######################################################
BaR = 10 #radius of the ball (balldia)
BaS = 1 #Scalar of speed for ball (ballspeed)
Bh = 5 #Y-value of individual books (bookheight)
Bw = 30 #X-value of the individual books (bookwidth)
Bs = -100 #X-value of the centerpoint of the stack of books (bookstack)
Tt = 0 #refrence point for drawing the books (tabletop)
Bc = 1 #condition for beginning to draw books (checked against time)(numberbooks)
R1L = 100 #Length of down ramp (ramplength)
R1T = 10 #height of the ramp (rampthickness)
nB = 8 #The number of books in the initial stack (numberofbooks)
A1 = .1 #acceleration for ramp 1 determined by students from data
 
###########################################################################################
 
 
# Introduction of Objects#################################################################
#books drawn one at a time in code
#ramp drawn on top of books in code
#ball drawn on top of ramp in code
 
##########################################################################################
 
 
# Time and time step######################################################################
t = 0 #start time
t2 = 0 #start line for second stack of books ***
tFinal = 100 #First phase final time
dt = 1 #rate of time change
##########################################################################################
 
 
#MAIN CODE LOCATED BELOW
 
#Ramp and speed calculations##############################################################
R1Y = Bh*nB #Starting Y-value of top of ramp  (rampy)
R1X = sqrt(R1L**2 - R1Y**2) #distance of ramp from stack of books (x-value) (rampx)
S1x = R1X/R1L*BaS #the horizontal vector of movement (speedx)
S1y = R1Y/R1L*BaS #the vertical vector of movement (speedy)
A1x = R1X/R1L*A1 # horizontal acceleration
A1y = R1Y/R1L*A1 # vertical acceleration
##########################################################################################
 
 
#Drawing initial objects##################################################################
#draw tabletop
Table= box(pos = vector(75,-6,0), size = vector(400, 10, 30), color = color.orange)
 
#Stack of books
Bc = Tt
while t<nB:
    Bc = Tt + Bh*t +Bh/2
    book = cylinder(pos = vector(Bs, Bc, 0), axis = vec(Bw, 0, 0), radius = Bh, color = color.yellow)
    t=t+1
t=t+1
 
#Downward Ramp
R1h = Tt + Bh*t +Bh/2
R1s = Bs + Bw
ramp1 = cylinder(pos = vector(R1s, R1h, 0), axis = vec(R1X, -R1Y, 0), radius = Bh, color = color.white)
 
#Ball
BaX = R1s + BaR/2 
BaY = R1h+Bh + BaR/2
ball =  sphere(pos=vec(BaX,BaY,0), radius = BaR/2, color=color.red)
 
scene.camera.follow(ball) #this makes the camera follow the ball
t=0 #reset counter to zero
###########################################################################################
 
#Command for ball rolling down first ramp##################################################
while t<tFinal:
    rate(20) #how many times per second the action will take place
    ball.pos.x = ball.pos.x + S1x
    ball.pos.y = ball.pos.y - S1y
    S1x = S1x + A1x
    S1y = S1y + A1y
    t=t+1
 
#Stopping ball motion at end of ramp #see if the ball is at the position of the ramp + rampx (total position on the screen is the two combined
 
    if ball.pos.x > R1s + R1X:
        t=tFinal