Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
repository:terminal_velocity [2020/09/01 16:49]
porcaro1 [Activity]
repository:terminal_velocity [2021/02/18 19:17] (current)
porcaro1 [Answer Key]
Line 22: Line 22:
 ====Activity==== ====Activity====
 ===Handout=== ===Handout===
 +{{ :​repository:​terminal_velocity.png?​nolink&​600|}}
 ** Terminal Velocity **  ** Terminal Velocity ** 
  
Line 30: Line 31:
   - Using information provided by the code, calculate the terminal velocity of the falling coin. Label each part of the terminal equation, including units.   - Using information provided by the code, calculate the terminal velocity of the falling coin. Label each part of the terminal equation, including units.
  
-==Post-coding Questions==+Now with your group, complete the provided code. Be sure to include arrows showing the magnitude of forces acting on the coin. As well, create a velocity vs. time graph and a forces vs. time graph (Pre-coding Questions 1 and 2). When your code is complete, answer the following questions:​ 
 +==Post-coding Questions/Reflection==
   - Describe your contributions to the coding process within your group.   - Describe your contributions to the coding process within your group.
   - What did you find the terminal velocity to be based on the graph produced by the code? Does this agree with your calculations?​   - What did you find the terminal velocity to be based on the graph produced by the code? Does this agree with your calculations?​
   - Reflect on your predicted graphs. Explain how they were similar/​different than your coding graphs. Revise your graphs as needed.   - Reflect on your predicted graphs. Explain how they were similar/​different than your coding graphs. Revise your graphs as needed.
 ===Code=== ===Code===
-[[https://​www.glowscript.org/#/​user/​david.pastula/folder/MyPrograms/​program/​TerminalVelocity-MinimalProgram/​edit ​| Link]]+[[hthttps://​www.glowscript.org/#/​user/​porcaro1/folder/RepositoryPrograms/​program/​TerminalVelocity-Incomplete ​| Link]]
 <code Python [enable_line_numbers="​true"​]>​ <code Python [enable_line_numbers="​true"​]>​
 GlowScript 2.8 VPython GlowScript 2.8 VPython
Line 97: Line 99:
 ===Handout=== ===Handout===
 ==Pre-coding Answers== ==Pre-coding Answers==
-  - INSERT PICTURE +  - {{:​repository:​terminal_velocity_velocity.png?​nolink&​600|}} 
-  - INSERT PICTURE +  - {{:​repository:​terminal_velocity_forces.png?​nolink&​600|}} 
-  - The equation for terminal velocity is $V=\sqrt{\dfrac{2W}{C\rho A}}$, where +  - The equation for terminal velocity is $v=\sqrt{\dfrac{2W}{C\rho A}}$, where 
-    ​$W$ is the weight of the coin (N) +    ​$W$ is the weight of the coin (N) 
-      ​this is calculated by multiplying the mass of the coin by the acceleration of gravity: $W= 0.01135 \text{kg} * 9.81 \text{m/​s/​s} = 0.111 \text{N}$ +      ​this is calculated by multiplying the mass of the coin by the acceleration of gravity: $W= 0.01135 \text{kg} * 9.81 \text{m/​s/​s} = 0.111 \text{N}$ 
-    ​$C$ is the drag coefficient (1.15, no units) +    ​*  ​$C$ is the drag coefficient (1.15, no units) 
-    ​$\rho$ is the density of air (1.2754 kg/m³) +    ​*  ​$\rho$ is the density of air (1.2754 kg/m³) 
-    ​$A$ is the area of the coin +    ​*  ​$A$ is the area of the coin 
-      ​this is calculated by squaring the radius of the coin and multiplying it by pi: $A= (0.015305 \text{m})^2 * \pi = 0.000736 \text{m²}$ +      ​*  ​this is calculated by squaring the radius of the coin and multiplying it by pi: $A= (0.015305 \text{m})^2 * \pi = 0.000736 \text{m²}$ 
-    ​$v=\sqrt{\dfrac{2*0.111}{1.15*1.275*0.000736}}=14.3 \text{m/s}$+    ​*  ​$v=\sqrt{\dfrac{2*0.111}{1.15*1.275*0.000736}}=14.3 \text{m/s}$ 
 + 
 +==Post-coding Answers== 
 +Use the previous answers and the completed code below to guide your reflection.
 ===Code=== ===Code===
-<code Python [enable_line_numbers="​true",​ highlight_lines_extra=""​]>​+[[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​TerminalVelocity-Solution | Link]] 
 +<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​24,​25,​28,​29,​44,​46,​47,​48,​49,​50,​51,​54,​55,​56,​57"]> 
 +GlowScript 2.8 VPython 
 +#Window Setup 
 +scene.width = 500 
 +scene.height = 400 
 + 
 +#Objects 
 +ground = box(pos=vec(0,​-250,​0),​ size=vec(700,​100,​2),​ texture="​https://​images.pexels.com/​photos/​207204/​pexels-photo-207204.jpeg?​auto=compress&​cs=tinysrgb&​h=750&​w=1260"​ ) 
 +coin = cylinder(pos=vector(0,​0,​0),​ axis=vector(0.5,​0,​0),​ radius=15.305,​ textures=textures.metal) 
 +coin.rotate(angle=90,​ axis=vector(1,​1,​1)) 
 + 
 +#Initial Object Properties and Constants (time and time step) 
 +g = vec(0,​-9.81,​0) #​Acceleration due to Gravity 
 +coin_m = 0.01135 #mass of the object 
 +drag_co = 1.15 #Drag Coefficient of  
 +t = 0 #Initial Time 
 +dt = 0.05 #Time Step 
 +tf = 0 #Final Time 
 +air_density = 1.2754 #Density of the air 
 +coin_r = .015305 
 +Fgrav = vector(0,​coin_m*g.y,​0) 
 +Fdrag = vec(0,​0,​0) 
 + 
 +#Velocity and Momentum Vectors 
 +coin_v = vec(0,0,0) #Initial Velocity 
 +coin_p = coin_m*coin_v #Initial Momentum 
 + 
 +#Create an arrow to visualize the particle'​s forces 
 +FdragArrow = arrow(pos=coin.pos,​ axis = Fdrag*1000, color = color.green) 
 +FgravArrow = arrow(pos=coin.pos,​ axis = Fgrav*1000, color = color.red) 
 + 
 +#Set up the graphs 
 +force_comparison_graph = graph(title='​Comparison of Forces on a Coin Reaching Terminal Velocity',​xtitle='​time (s)',​ytitle='​Force (N)',​fast=False,​width=1000) 
 +velocity_graph = graph(title='​Velocity of a Coin in Freefall Over Time',​xtitle='​time (s)', ytitle='​Velocity (m/​s)',​fast=False,​width=1000) 
 +#Drag and Fgrav and Fnet on the same plot 
 + 
 +Fdrag_f = gcurve(graph=force_comparison_graph,​color=color.red,​width=4,​markers=False,​label='​Drag Force'​) 
 +Fgrav_f = gcurve(graph=force_comparison_graph,​color=color.blue,​width=4,​markers=False,​label='​Fgrav'​) 
 +Fnet_f = gcurve(graph=force_comparison_graph,​color=color.purple,​width=4,​markers=False,​label='​Fnet'​) 
 + 
 +#Velocity on its own plot 
 +velocity_f = gcurve(graph=velocity_graph,​color=color.green,​width=4,​markers=False,​label='​Coin Velocity'​) 
 + 
 +#​Calculation Loop 
 +while coin.pos.y > -200: #Makes the coin stop when it hits the ground 
 +    rate(100) 
 +    Fgrav = vector(0,​coin_m*g.y,​0) 
 +    Fdrag = vec(0,​air_density*drag_co*pi*coin_r**2*coin_v.y**2/​2,​0) 
 +    Fnet = Fgrav+Fdrag 
 +    coin_p += Fnet*dt 
 +    coin.pos += (coin_p/​coin_m)*dt 
 +    coin_v = coin_p/​coin_m 
 +     
 +    #Keep the arrow representing the particle'​s velocity and acceleration 
 +    FdragArrow.pos = coin.pos 
 +    FdragArrow.axis = Fdrag*1000 
 +    FgravArrow.pos = coin.pos 
 +    FgravArrow.axis = Fgrav*1000 
 + 
 +    #Plot on the graphs  
 +    velocity_f.plot(t,​coin_v.y) 
 +    Fdrag_f.plot(t,​Fdrag.y) 
 +    Fgrav_f.plot(t,​Fgrav.y) 
 +    Fnet_f.plot(t,​Fnet.y) 
 +     
 +    t += dt #Advance the time by 1 time step
 </​code>​ </​code>​
  
 ---- ----
 ====See Also==== ====See Also====
-  *+  *[[beating_the_train | Beating the Train]]
   ​   ​
  • repository/terminal_velocity.1598978961.txt.gz
  • Last modified: 2020/09/01 16:49
  • by porcaro1