Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
repository:head-on_collision [2020/08/18 15:09] porcaro1 [Activity Information] |
repository:head-on_collision [2021/02/17 17:46] porcaro1 [Answer Key] |
||
---|---|---|---|
Line 2: | Line 2: | ||
====Activity Information==== | ====Activity Information==== | ||
===Learning Goals=== | ===Learning Goals=== | ||
- | *Students will be able to apply the principles of constant velocity motion | + | *Students will be able to apply the principles of constant velocity motion ([[https://www.nextgenscience.org/pe/hs-ps2-1-motion-and-stability-forces-and-interactions | HS-PS2-1]]) |
- | *Students will be able to create and modify computational models to describe and show a given system | + | *Students will be able to create and modify computational models to describe and show a given system |
===Prior Knowledge Required=== | ===Prior Knowledge Required=== | ||
*Units | *Units | ||
Line 17: | Line 17: | ||
====Activity==== | ====Activity==== | ||
===Handout=== | ===Handout=== | ||
+ | {{ :repository:head-on_collision.png?nolink&600|}} | ||
** Head-On Collision ** | ** Head-On Collision ** | ||
+ | |||
You are part of a team that has been directed to film a head-on car crash for an action movie. You only have the funding for one take! So you must calculate where the crash will occur so that you can determine where to place the camera to get the shot. | You are part of a team that has been directed to film a head-on car crash for an action movie. You only have the funding for one take! So you must calculate where the crash will occur so that you can determine where to place the camera to get the shot. | ||
+ | Look over the code (provided below) and determine: | ||
+ | - The initial positions of the vehicles | ||
+ | - The velocities of the vehicles | ||
+ | - Where and when the crash will occur | ||
+ | Once you have answered these questions, modify the code to test your answers. | ||
+ | |||
+ | //**Note:**// when conducting this activity with students, the initial positions and velocities of the vehicles can be provided by the instructor, but for demonstration purposes they have been included in the code below. | ||
===Code=== | ===Code=== | ||
+ | [[https://www.glowscript.org/#/user/porcaro1/folder/RepositoryPrograms/program/Head-OnCollision-Incomplete | Link]] | ||
<code Python [enable_line_numbers="true"]> | <code Python [enable_line_numbers="true"]> | ||
GlowScript 2.7 VPython | GlowScript 2.7 VPython | ||
Line 29: | Line 39: | ||
scene.height = 400 | scene.height = 400 | ||
scene.background = vector(0.7,0.7,0.6) | scene.background = vector(0.7,0.7,0.6) | ||
- | |||
- | |||
#Definition of objects in the system...***DO NOT CHANGE ANY OF THESE VALUES!! | #Definition of objects in the system...***DO NOT CHANGE ANY OF THESE VALUES!! | ||
Line 38: | Line 46: | ||
#Set the velocity for each vehicle | #Set the velocity for each vehicle | ||
- | greentruck.velocity = vector(0,0,0) | + | redcar.velocity = vector(25,0,0) |
- | redcar.velocity = vector(0,0,0) | + | greentruck.velocity = vector(-40,0,0) |
#Time and Time step | #Time and Time step | ||
Line 56: | Line 64: | ||
| | ||
greentruck.pos.x = greentruck.pos.x + greentruck.velocity.x *dt | greentruck.pos.x = greentruck.pos.x + greentruck.velocity.x *dt | ||
- | | ||
| | ||
t = t + dt | t = t + dt | ||
Line 69: | Line 76: | ||
====Answer Key==== | ====Answer Key==== | ||
===Handout=== | ===Handout=== | ||
+ | - The initial position of the red car is 350 feet to the left of the origin (line 11) and the initial position of the green truck is 450 feet to the right of the origin (line 12) | ||
+ | - The velocity of the red car is 25 ft/s in the positive x-direction (line 15) and the velocity of the green truck is -40 ft/s in the negative x-direction (line 16) | ||
+ | - We can determine where and when the crash occurs by using the following kinematic equation: $x=x_0 + vt$, where $x$ is the final position, $x_0$ is the initial position, $v$ is the velocity, and $t$ is the time. We can create an equation for the red car ($x=-350 + 25t$) and the green truck ($x=450 - 40t$). Since we want to know where and when the vehicles are when they collide, we can set these two equations equal to each other to solve for the unknowns ($x$ and $t$): $$-350 + 25t=450 - 40t$$ Using algebra, we can solve for $t$: $65t = 800$, therefore $t = 12.3$ s. We can plug this into either of the two equations we created to find out the position where the vehicles collide: $x=-350 + 25*12.3=-42.5$ ft. In other words, the vehicles will collide 42.5 ft to the left of the origin after 12.3 seconds. | ||
+ | |||
+ | The correctly modified code is shown below, with highlighted areas revealing important modifications. | ||
===Code=== | ===Code=== | ||
- | <code Python [enable_line_numbers="true", highlight_lines_extra=""]> | + | [[https://www.glowscript.org/#/user/porcaro1/folder/RepositoryPrograms/program/Head-OnCollision-Solution | Link]] |
+ | <code Python [enable_line_numbers="true", highlight_lines_extra="28"]> | ||
+ | GlowScript 2.7 VPython | ||
+ | |||
+ | scene.range = 450 | ||
+ | scene.center = vector(200,0,0) | ||
+ | scene.width = 1000 | ||
+ | scene.height = 400 | ||
+ | scene.background = vector(0.7,0.7,0.6) | ||
+ | |||
+ | #define objects in system | ||
+ | ground = box(pos=vector(-120,-10,0),length=1200, height=20, width=20,color=color.blue) | ||
+ | redcar = box(pos=vector(-350,10,0), length=40, height=20, width=20, color=color.red) | ||
+ | greentruck = box(pos=vector(450,10,0), length=40, height=20, width=20, color=color.green) | ||
+ | |||
+ | #Set the velocity for each vehicle | ||
+ | redcar.velocity = vector(25,0,0) | ||
+ | greentruck.velocity = vector(-40,0,0) | ||
+ | |||
+ | |||
+ | #Time and Time step | ||
+ | t=0 | ||
+ | tf=25 | ||
+ | dt = 0.01 | ||
+ | |||
+ | #Click Screen to Start | ||
+ | scene.waitfor('click') | ||
+ | |||
+ | #Calculation Loop | ||
+ | while greentruck.pos.x > -42.32: | ||
+ | rate (500) | ||
+ | |||
+ | redcar.pos.x = redcar.pos.x + redcar.velocity.x * dt | ||
+ | |||
+ | greentruck.pos.x = greentruck.pos.x + greentruck.velocity.x *dt | ||
+ | |||
+ | t = t + dt | ||
+ | |||
+ | #Text to be displayed on computer screen | ||
+ | print ("Time = ",t) | ||
+ | print ("Car Position x = ",redcar.pos.x) | ||
+ | |||
+ | print ("Truck Position x = ",greentruck.pos.x) | ||
</code> | </code> | ||
---- | ---- | ||
====See Also==== | ====See Also==== | ||
- | * | + | *[[colliding_crates | Colliding Crates]] |
+ | *[[rear-end_collision | Rear-End Collision]] | ||
+ | *[[phineas_&_ferb | Phineas & Ferb]] | ||
| |