Activity Description

Learning Goals

  • Interpret and edit the code of a computer model of a block sliding down a ramp
  • Use vectors to describe the motion of a block on a ramp and the forces acting upon it
  • Apply Newton's 2nd Law to relate the acceleration of a block on a ramp to the forces acting on it

Prior Knowledge Required

  • 2-Dimensional kinematics
  • Newton's 2nd Law
  • Friction
    • Coefficient of friction $\mu$

Code Manipulation

  • Interpretation of preexisting code
  • Changing values of given code
  • Creation of new lines of code

Activity

Handout

Block on a Ramp

Part 1
We’ve used forces to predict the motion of objects on level surfaces. What happens when the object is on a ramp? Click here to open the code for a model of a block on a ramp. Copy and paste the code into your own Glowscript program.

  1. What is the angle of the ramp?
  2. What else can you change about the ramp?
  3. What is the distance along the ramp that the block will travel?
  4. What is the while loop used for?
  5. What are the components of the net force vector?
  6. What are the components of the acceleration vector for the block? Where does the acceleration of the block show up within the code?

Part 2
Observe and explain what happens when you change physical features of the ramp and block.

  1. What happens to the net force as the block slides down the ramp? How do you know?
  2. What happens if you increase the angle of the ramp? Why does that happen?
  3. What happens to the motion of the block if you increase the mass? How can you be sure?

Part 3
The simulation currently shows a block sliding down a frictionless ramp.

  1. Modify the code so that the ramp now has a coefficient of friction equal to 0.3. Then create and label an arrow to represent the frictional force acting on the block
  2. Challenge: create a model including static friction

Code

Link

  1. GlowScript 2.7 VPython
  2. #Call the library for Motion Map
  3. get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js')
  4.  
  5. #Window setup
  6. scene.range = 15
  7. scene.background = vector(1, 1, 0.8)
  8.  
  9.  
  10. #the values below can be adjusted to change the properties of the ramp
  11. ramp_angle = 23 * pi/180
  12. ramp_depth = 6
  13. ramp_width = 30
  14. ramp_position = vec(-15, -10, 0)
  15.  
  16. #the code below draws the ramp (lines 17 - 45)
  17. ramp_color = color.gray(0.3)
  18. edge_thickness = 0.05
  19. edge_color = color.black
  20.  
  21. a = vertex(pos=vec(0, 0, 0)+ramp_position, color=ramp_color, opacity=.5)
  22. b = vertex(pos=vec(0, 0, ramp_depth)+ramp_position, color=ramp_color, opacity=.5)
  23. c = vertex(pos=vec(ramp_width, 0, 0)+ramp_position, color=ramp_color, opacity=.5)
  24. d = vertex(pos=vec(ramp_width, 0, ramp_depth)+ramp_position, color=ramp_color, opacity=.5)
  25. e = vertex(pos=vec(0, ramp_width * tan(ramp_angle), 0)+ramp_position, color=ramp_color, opacity=.5)
  26. f = vertex(pos=vec(0, ramp_width * tan(ramp_angle), ramp_depth)+ramp_position, color=ramp_color, opacity=.5)
  27.  
  28. ramp_base = quad(v0=a, v1=b, v2=d, v3=c)
  29. ramp_surface = quad(v0=e, v1=f, v2=d, v3=c)
  30. ramp_back = quad(v0=e, v1=f, v2=b, v3=a)
  31. ramp_side_near = triangle(vs=[a, c, e])
  32. ramp_side_far = triangle(vs=[b, d, f])
  33.  
  34. def edge(v1, v2, r):
  35. cylinder(pos = v1.pos, axis = v2.pos-v1.pos, radius = r, color = edge_color)
  36.  
  37. ab = edge(a, b, edge_thickness)
  38. ac = edge(a, c, edge_thickness)
  39. bd = edge(b, d, edge_thickness)
  40. cd = edge(c, d, edge_thickness)
  41. ae = edge(a, e, edge_thickness)
  42. bf = edge(b, f, edge_thickness)
  43. ef = edge(e, f, edge_thickness)
  44. df = edge(d, f, edge_thickness)
  45. ec = edge(e, c, edge_thickness)
  46.  
  47.  
  48. #The values below can be changed to modify the dimensions of the block
  49. block_width = 3
  50. block_height = 3
  51. block_depth = 3
  52.  
  53. #Create the block on the ramp
  54. block = box( pos=vector(0.5*(block_width**2+block_height**2)**0.5 * cos(atan(block_height/block_width) - ramp_angle), ramp_width * tan(ramp_angle) + 0.5*(block_width**2+block_height**2)**0.5 * sin(atan(block_height/block_width) - ramp_angle), 0.5*ramp_depth) + ramp_position,
  55. axis=vector(ramp_width, -ramp_width * tan(ramp_angle), 0),
  56. size=vector(block_width,block_height,block_depth),
  57. color = vector(0.65, 0.15, 0.15),
  58. texture = textures.wood_old,
  59. opacity = 0.7)
  60.  
  61.  
  62. #Set up the physical properties like the mass and velocity of the block, the acceleration due to gravity, and time.
  63. mblock = 50
  64. vblock = vector(0, 0, 0)
  65. g = vector(0,-9.8,0)
  66. t = 0
  67. tf = 5
  68. dt = .001
  69.  
  70. #Define the force vectors acting on the block
  71. Fgrav = mblock * g
  72. Fnorm = vector(mag(Fgrav) * cos(ramp_angle)*sin(ramp_angle), mag(Fgrav)*cos(ramp_angle)*cos(ramp_angle), 0)
  73. Fnet = Fgrav + Fnorm
  74.  
  75. #Create arrows to show the forces with labels
  76. FgravArrow = arrow(pos = block.pos, axis=Fgrav/mblock, shaftwidth=0.3, color = color.green)
  77. FnormArrow = arrow(pos = block.pos, axis=Fnorm/mblock, shaftwidth=0.3, color = color.green)
  78. FgravLabel = label(pos=FgravArrow.pos, text='Fg', xoffset=-20, yoffset=-50, space=30, height=16, border=4, font='sans', line=False, color = color.black)
  79. FnormLabel = label(pos=FnormArrow.pos, text='Fn', xoffset=20, yoffset=50, space=30, height=16, border=4, font='sans', line=False, color = color.black)
  80.  
  81. #Slide the block down the ramp
  82. while block.pos.y > ( ramp_position.y+ 0.5*(block_width**2+block_height**2)**0.5 * cos(atan(block_width/block_height) - ramp_angle) ):
  83. rate(500)
  84.  
  85.  
  86. block.pos = block.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  87.  
  88. FgravArrow.pos = FgravArrow.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  89. FnormArrow.pos = FnormArrow.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  90. FgravLabel.pos = FgravLabel.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  91. FnormLabel.pos = FnormLabel.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  92.  
  93. vblock = vblock + (Fnet/mblock)*dt
  94. t = t + dt

Answer Key

Handout

Part 1

  1. 23° (0.401 rad)
    1. Line 11
  2. Width, depth, position
    1. Lines 12-14
  3. We currently know the ramp angle and ramp width. Using trigonometry, we can solve for the distance along the ramp (i.e. the hypotenuse):
    1. The formula relating angle, width, and hypotenuse is $\cos(\theta) = \dfrac{\text{width}}{\text{hypotenuse}}$
    2. This can be rearranged as: $\text{hypotenuse} = \dfrac{\text{width}}{\cos(\theta)}$
    3. Plugging in what we know: $\text{hypotenuse} = \dfrac{\text{30}}{\cos(23°)} = 32.6$
  4. The while loop moves the block down the ramp by updating its position according to the following kinematic equation: $x = x_0 + v_0t + \dfrac{1}{2}at^2$
  5. The net force vector (“Fnet”, line 73) is the sum of the gravitational force vector (“Fgrav”, line 71) and the normal force vector (“Fnorm”, line 72)
    1. $\text{Fgrav} = \text{<0, -490, 0>}$
    2. $\text{Fnorm} = \text{<173.2, 415.2, 0>}$
    3. $\text{Fnet} = \text{<173.2, -74.8, 0>}$
  6. According to Newton's 2nd Law, force equals mass multiplied by acceleration. To find the acceleration vector, we can divide the net force vector “Fnet” by the mass of the block “mblock”
    1. $\vec{a} = \dfrac{\text{Fnet}}{\text{mblock}}=\dfrac{\text{<173.2, -74.8, 0>}}{\text{50}} = \text{<3.5, -1.5, 0>}$

Part 2

  1. The net force stays the same, since the gravitational force and the normal force remain constant
  2. The box will accelerate faster; As the angle of the ramp increases, the x-component of the normal force becomes larger while the y-component of the normal force becomes smaller. Essentially, the ramp becomes steeper and gravity will have a stronger effect on the block
  3. The motion of the block is not affected by changing the mass. Fgrav is defined using the mass and Fnorm is defined using Fgrav, so Fnet can be written entirely in terms of Fgrav. So when the code divides Fnet by the mass to find the acceleration, the mass cancels out altogether. Think of Galileo's Leaning Tower of Pisa experiment; the principle is the same.

Part 3

  1. See highlighted lines below
    1. Lines 66, 74, 75, 80, 83, 95, & 98

Code

Link

  1. GlowScript 2.7 VPython
  2. #Call the library for Motion Map
  3. get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js')
  4.  
  5. #Window setup
  6. scene.range = 15
  7. scene.background = vector(1, 1, 0.8)
  8.  
  9.  
  10. #the values below can be adjusted to change the properties of the ramp
  11. ramp_angle = 23 * pi/180
  12. ramp_depth = 6
  13. ramp_width = 30
  14. ramp_origin = vec(-15, -10, 0)
  15.  
  16. #the code below draws the ramp (lines 17 - 45)
  17. ramp_color = color.gray(0.3)
  18. edge_thickness = 0.05
  19. edge_color = color.black
  20.  
  21. a = vertex(pos=vec(0, 0, 0)+ramp_origin, color=ramp_color, opacity=.5)
  22. b = vertex(pos=vec(0, 0, ramp_depth)+ramp_origin, color=ramp_color, opacity=.5)
  23. c = vertex(pos=vec(ramp_width, 0, 0)+ramp_origin, color=ramp_color, opacity=.5)
  24. d = vertex(pos=vec(ramp_width, 0, ramp_depth)+ramp_origin, color=ramp_color, opacity=.5)
  25. e = vertex(pos=vec(0, ramp_width * tan(ramp_angle), 0)+ramp_origin, color=ramp_color, opacity=.5)
  26. f = vertex(pos=vec(0, ramp_width * tan(ramp_angle), ramp_depth)+ramp_origin, color=ramp_color, opacity=.5)
  27.  
  28. ramp_base = quad(v0=a, v1=b, v2=d, v3=c)
  29. ramp_surface = quad(v0=e, v1=f, v2=d, v3=c)
  30. ramp_back = quad(v0=e, v1=f, v2=b, v3=a)
  31. ramp_side_near = triangle(vs=[a, c, e])
  32. ramp_side_far = triangle(vs=[b, d, f])
  33.  
  34. def edge(v1, v2, r):
  35. cylinder(pos = v1.pos, axis = v2.pos-v1.pos, radius = r, color = edge_color)
  36.  
  37. ab = edge(a, b, edge_thickness)
  38. ac = edge(a, c, edge_thickness)
  39. bd = edge(b, d, edge_thickness)
  40. cd = edge(c, d, edge_thickness)
  41. ae = edge(a, e, edge_thickness)
  42. bf = edge(b, f, edge_thickness)
  43. ef = edge(e, f, edge_thickness)
  44. df = edge(d, f, edge_thickness)
  45. ec = edge(e, c, edge_thickness)
  46.  
  47.  
  48. #The values below can be changed to modify the dimensions of the block
  49. block_width = 3
  50. block_height = 3
  51. block_depth = 3
  52.  
  53. #Create the block on the ramp
  54. block = box( pos=vector(0.5*(block_width**2+block_height**2)**0.5 * cos(atan(block_height/block_width) - ramp_angle), ramp_width * tan(ramp_angle) + 0.5*(block_width**2+block_height**2)**0.5 * sin(atan(block_height/block_width) - ramp_angle), 0.5*ramp_depth) + ramp_origin,
  55. axis=vector(ramp_width, -ramp_width * tan(ramp_angle), 0),
  56. size=vector(block_width,block_height,block_depth),
  57. color = vector(0.65, 0.15, 0.15),
  58. texture = textures.wood_old,
  59. opacity = 0.7)
  60.  
  61.  
  62. #Set up the physical properties like the mass and velocity of the block, the acceleration due to gravity, time and the coefficient of friction.
  63. mblock = 50
  64. vblock = vector(0, 0, 0)
  65. g = vector(0,-9.8,0)
  66. cof = 0.3 #coefficient of friction#
  67. t = 0
  68. tf = 5
  69. dt = .001
  70.  
  71. #Define the force vectors acting on the block, including kinetic friction
  72. Fgrav = mblock * g
  73. Fnorm = vector(mag(Fgrav) * cos(ramp_angle)*sin(ramp_angle), mag(Fgrav)*cos(ramp_angle)*cos(ramp_angle), 0)
  74. Ffr = vector(-cof*mag(Fnorm)*cos(ramp_angle), cof*mag(Fnorm)*sin(ramp_angle), 0)
  75. Fnet = Fgrav + Fnorm + Ffr
  76.  
  77. #Create arrows to show the forces with labels
  78. FgravArrow = arrow(pos = block.pos, axis=Fgrav/mblock, shaftwidth=0.3, color = color.green)
  79. FnormArrow = arrow(pos = block.pos, axis=Fnorm/mblock, shaftwidth=0.3, color = color.green)
  80. FfrArrow = arrow(pos = block.pos, axis=Ffr/mblock, shaftwidth=0.3, color = color.green)
  81. FgravLabel = label(pos=FgravArrow.pos, text='Fg', xoffset=-20, yoffset=-50, space=30, height=16, border=4, font='sans', line=False, color = color.black)
  82. FnormLabel = label(pos=FnormArrow.pos, text='Fn', xoffset=-10, yoffset=70, space=30, height=16, border=4, font='sans', line=False, color = color.black)
  83. FfrLabel = label(pos=FfrArrow.pos, text='Ffr', xoffset=-30, yoffset=30, space=30, height=16, border=4, font='sans', line=False, color = color.black)
  84.  
  85.  
  86. #Slide the block (and arrows) down the ramp until it reaches the end of the ramp
  87. while block.pos.y > ( ramp_origin.y+ 0.5*(block_width**2+block_height**2)**0.5 * cos(atan(block_width/block_height) - ramp_angle) ):
  88. rate(500)
  89.  
  90.  
  91. block.pos = block.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  92.  
  93. FgravArrow.pos = FgravArrow.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  94. FnormArrow.pos = FnormArrow.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  95. FfrArrow.pos = FfrArrow.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  96. FgravLabel.pos = FgravLabel.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  97. FnormLabel.pos = FnormLabel.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  98. FfrLabel.pos = FfrLabel.pos + vblock*dt + 0.5*(Fnet/mblock)*dt**2
  99.  
  100. vblock = vblock + (Fnet/mblock)*dt
  101. t = t + dt

See Also

  • repository/block_on_a_ramp.txt
  • Last modified: 2020/02/18 15:59
  • by porcaro1