course_planning:183_projects:f21_week_1_escape_from_ice_station_mcmurdo

Fall 2019 Project 2

  • Predict the motion of a single-particle system executing constant velocity or constant acceleration motion using appropriate representations (this includes verbal, graphical, diagrammatic, mathematical, and computational representations).
  • Collect, analyze, and evaluate data to determine the type of motion and the properties of the motion of a single-particle system.
  • Evaluate the applicability/limitations of models and the validity of predictions for different types of motion.
  • Apply the momentum principle ($\Delta\vec{p}=\vec{F}\,\Delta t$; $d\vec{p}=\vec{F}\,dt$) iteratively/computationally to predict the motion or determine the properties of motion/net force acting on a single-particle system where the net force is not constant (e.g., due to spring-like restoring forces or dissipative drag forces).
  • Forces cause changes in momentum
  • Kinematic Equations - Constant Acceleration
  • Gravitational Force Near Earth
  • Vector Components
  • $\vec{F}_{net} = m\:\vec{a} = \dfrac{\Delta\vec{p}}{\Delta t}$
  • Iterative Prediction of Motion

Project 2: Part A: Escape from ice station McMurdo

You are a member of a scientific research team at McMurdo ice station which is funded by the Carver Media Group in Antarctica.

Two members of your research team have recently returned from investigating an incident at a Norwegian research facility. They brought with them a burnt humanoid body with two faces. Since the disturbing discovery several inhabitants of the ice station have disappeared. Frightened, a member of your team decided to flee the station on a fan powered hovercraft but you receive a distress call not long after their escape that their steering and acceleration controls have been jammed and they need your help.

Time Your Team Member's Position Your Position
0 s 2536.40 m 10.47 m
10 s 3072.80 m 41.88 m
20 s 3609.20 m 94.22 m

You decide to attempt a rescue in another hovercraft. You must decide how many members of your team help in the rescue operation. The hovercrafts do not have a velocity or acceleration gauge but they do have GPS locators and you possess your trusty stop watch. The GPS locator tells you the exact position of both your craft and other team members craft relative to the ice station. You are following their path. You collect the following data for the first 20 seconds of your journey.

You need to tell the runaway researcher the exact time from your starting time to jump onto your hovercraft as you may only have one shot at this rescue.

Project 2 Solution: Part A: Escape from ice station McMurdo

Students must complete this entire problem to work on Part B. They need information from this problem to solve Part B.

We expect students to complete Part A and Part B in class on Tuesday, but, historically about 1/2 of the groups do not completely finish part B. This is OK, they can have 15 minutes on Thursday to finish up. The Main Points below will articulate where we expect students to get by the end of Tuesday.

Most formulas used in part are are simply kinematic equation. A brief outline of these are found in the notes under Constant Force Motion.

Using the data from the first 20 seconds, we compute the velocity and acceleration of both the runaway ($X,V,A$) and rescue ($x,v,a$) hovercrafts:

Time Runaway Pos. ($X$) Rescue Pos. ($x$) Runaway Vel. ($V$) Rescue Vel. ($v$) Runaway Accel. ($A$) Rescue Accel. ($a$)
0 s 2536.40 m 10.47 m
53.64 m/s 3.141 m/s
10 s 3072.80 m 41.88 m 0 m/s/s 0.2093 m/s/s
53.64 m/s 5.243 m/s
20 s 3609.20 m 94.22 m
Tutor Questions
  • Question: At what time(s) are the average velocities for the Rescue hovercraft equal to the observed velocity of the hovercraft? How do you know?
  • Expected Answer: These velocities occurs at 5s and 15s. Because this craft moves under constant force motion, we know that the average velocity and the arithmetic average velocity are the same, and the instantaneous velocity occurs halfway between the two time points because it changes linearly.

Now, to make things as simple as possible, we assume that the rescue cart not only starts from rest, but also accelerates uniformly (constant force from the hovercraft fan) throughout the duration of its rescue mission. Accordingly, the positions in time for both crafts are given by $$X(t)=X_{0{\rm s}}+V t\qquad\mbox{and}\qquad x(t)=x_{0{\rm s}}+\frac{1}{2}at^{2}.$$ Since we want to find the time at which the carts are at the same location, we set the above equations equal and solve for the time: $$t_{\rm jump}=\frac{V\pm\sqrt{V^{2}+2a(X_{0{\rm s}}-x_{0{\rm s}})}}{a}\approx 555.979\,{\rm s}.$$

It then follows, plugging this time back into either position equation, that the location of interest is $$x_{\rm jump}\approx 32359\,{\rm m,}$$ quite a ways away.

Tutor Questions
  • Question: What assumptions did you make about the motion of the hovercrafts?
  • Expected Answer: That the runaway craft has a constant velocity, and the rescue craft starts from rest with a constant acceleration.
  • Question: Are these velocities and accelerations calculated from the numbers given exact?
  • Expected Answer: No, we would need to take measurements a lot closer together.
  • Question: Is the predicted position of the rescue craft a good one?
  • Expected Answer: Not really, basing the trajectory off the first 20 seconds of data is probably not the best – but it is all we have to work with.
  • Questions: Can you draw a plot of position vs. time for both crafts? What are the important features of this graph?
  • Expected Answer: The point where the two curves cross is when we should jump. One should be linear, the other quadratic.
  • Questions: Can you draw a plot of velocity vs. time for both crafts? What are the important features of this graph?
  • Expected Answer: The acceleration is the slope of each curve (constant in both cases).
Main Points
  • Students should complete this entire problem on Tuesday as they need to start working Part B. Historically, all groups have completed this problem on Tuesday and been able to move onto Part B.
  • Students should be able to recognize and justify the types of motion that the two hovercrafts are executing (constant velocity vs. constant force).
  • Students should be able to set up that relate the position and time of each hovercraft and solve them as simultaneous equations for when they are in the same location.
  • Students should be able to draw the motion of both hovercrafts (position/velocity vs time) and explain how these graphs represent the motion given their assumptions. It is very important that students discuss and sketch the motion of the two hovercrafts, so please ask these tutor questions even if you are pressed for time.

==Part A Steps and Timning:==

  • 4 quadrants, including the table and representation 20 minutes
  • Runaway craft - constant velocity 30 minutes
    • Using $v=\frac{d}{t}$ from adjacent data points
    • What kind of velocity is this? (average)
  • Rescue craft - changing velocity 45 minutes
    • Accelerating - assume constant
    • Use $v_{avg}$=$v_{inst}$ at the midpoint in time intervals (5 sec and 15 sec)
    • Calculate $a=\frac{\Delta v}{\Delta t}$
  • Assert position of rescue craft as $x_{f,res}=x_{i,run}+\frac{1}{2} a\cdot t^2$ 55 min
  • Final positions need to be equal at jump point solve for t and $x_f$ 65 min
    • Express final position as of runaway craft as $x_{f,run}=x_{i,run}+v_{run}\cdot t$
    • Algebra to solve
  • Graphing position and velocity of both crafts 75 min

== Teaching Points==

  • the rescue craft uses the average velocity over each interval
  • The average velocity used to find its acceleration is the instantaneous velocity at the midpoint in time.
    • $a= \frac{v_f - v_i}{t_f - t_i}$
    • Ask what velocities do you use, and when do they occur? At the midpoint in the interval
    • To help understand this, ask them t sketch a v-t diagram for constant acceleration - v increases at a constant rate. Ask them where on their graph the constantly changing velocity(instantaneous) is equal to the average velocity over the interval.
    • They can get the correct numerical value,but for the wrong reason (using times other than the midpoint) - ask them to explicitly show the velocities and times.
    • Intro to kinematics - stress only valid for constant force motion.

Parts A and B are meant to be done on the same day, but in practice half of the folks do not finish part B. It's okay to spend the first part of McMurdo day 2 to complete part B. They need to do this before doing the computational part C.

Common Difficulties
  • Some groups struggle to extract information from the table to determine what kind of motion is being executed by each hovercraft.
  • Solving these simultaneous equations can provide a bit of a challenge for some groups. You may remind them that WolframAlpha is useful tool to check (or do) that work.
  • Students should be pushed to graph a fairly quantitatively correct graph of the motion of each hovercraft. Extract meaning from their equations to do this can prove challenging.

Project 2: Part B: Escape from ice station McMurdo

Just as you are about to radio the time to jump to the runaway researcher, you realize the steering and acceleration controls have become frozen on your hovercraft and so it continues to accelerate and you cannot change direction. 200m ahead of the point at which you were going to tell the researcher to jump is an ice ravine. At the bottom of the ice ravine, 400m below, is an unfrozen salt water pool surrounded by stalagmites. From the ravine's edge to the pool is 490m and the pool stretches for 900m. You are moving too quickly to survive jumping off the hovercraft, but might survive the fall into the pool by staying on the hovercraft; it has seat belts. You now have a choice to make, to stay on your hovercraft or jump to the runaway researcher's hovercraft. One or both may make it to the pool. Your choice may be the difference between life and death.

Project 2 Solution: Part B: Escape from ice station McMurdo

Students are being asked to predict the motion of the hovercrafts after they leave the cliff. After students have discussed, the plan check with them and try to suggest they focus on one hovercraft: the runaway hovercraft (constant velocity). Let them come to this on their own as much as you can, but nudge to consider which “would be simpler to model.”

If they complete the model for the motion of that hovercraft by the end of Tuesday, that's what we expect. If they also finish modeling the motion of the rescue craft, that's great. But, you can give them 15 minutes on Thursday to finish that up and then talk you through it if they haven't finished.

To begin, we can calculate the velocities at $x_{\rm jump}$. The runaway craft has a constant velocity ($V=53.64\,{\rm m/s}$), but the rescue craft has velocity given by $v(t)=at.$ Using the time calculated in Part A, we find $$v_{\rm jump}=at_{\rm jump}\approx 116.366\,{\rm m/s}.$$ Furthermore, to find the velocity at the edge of the cliff, we make use of the constant acceleration kinematic equation which does not depend on time ($v_{f}^{2}=v_{i}^{2}+2ad$). Given the distance from the jump to the edge of the cliff, we may immediately find

$$v_{\rm edge}=\sqrt{v_{\rm jump}^{2}+2ad}\approx 116.726\,{\rm m/s},$$

where $d=200\,{\rm m}$.

Now, in order to calculate how far each hovercraft will shoot over the cliff, we need to know how long they will be in the air. Rearranging one of the constant acceleration kinematic equations gives

$$y_{f}=y_{i}+\frac{1}{2}at^{2}\qquad\longrightarrow\qquad t_{\rm air}=\sqrt{\frac{2H}{g}}\approx 9.03\,{\rm s},$$

where $H=400\,{\rm m}$ and $g=9.81\,{\rm m/s^{2}}$.

Tutor Questions
  • Question: Do the hovercrafts fall for the same amount of time? In other words, does one hovercraft fall faster than the other?
  • Expected Answer: Each hovercraft, though possibly feeling a different magnitude of force given differing masses, accelerates in the same way (due to local gravity). So, they have the same vertical speeds at each instant in time on the way down.

With this information, we can determine how far each hovercraft lands from the edge of the cliff: $$X_{\rm land}=Vt_{\rm air}\approx 484.395\,{\rm m}\qquad\mbox{and}\qquad x_{\rm land}=v_{\rm edge}t_{\rm air}\approx 1054.09\,{\rm m}.$$ It is clear that we would want to be on the rescue hovercraft.

Given the small magnitude of acceleration, there are a few different approximations that may be used in modeling this situation. Any combination of neglecting the acceleration of the rescue craft might be used both on and off land. The permutations give values as follows: \begin{eqnarray*} x_{\rm land}=v_{\rm jump}t_{\rm air}&\qquad\mbox{gives}\qquad& 1050.84\,{\rm m}\\ x_{\rm land}=v_{\rm jump}t_{\rm air}+\frac{1}{2}at_{\rm air}^{2}&\qquad\mbox{gives}\qquad& 1059.38\,{\rm m}\\ x_{\rm land}=v_{\rm edge}t_{\rm air}&\qquad\mbox{gives}\qquad& 1054.09\,{\rm m}\\ x_{\rm land}=v_{\rm edge}t_{\rm air}+\frac{1}{2}at_{\rm air}^{2}&\qquad\mbox{gives}\qquad& 1062.62\,{\rm m}\\ \end{eqnarray*} Encourage the simplest model. With time permitting, have them refine their model to add in more complexities. If necessary, mention that there is a killswitch which disengages the accelerating fans when the hovercraft is no longer on land to simplify things at the start..

Tutor Questions
  • Question: Can you draw a plot of horizontal and vertical position vs. time for the runaway craft? What are the important features of this graph?
  • Expected Answer: The horizontal plot should be linear – the slope being the constant velocity. The vertical plot should be quadratic opening downward.
  • Question: Can you draw a plot of horizontal and vertical speed vs. time for the runaway craft? What are the important features of this graph?
  • Expected Answer: The horizontal plot should be a flat line – no acceleration. The vertical plot should be linear – the slope being constant acceleration due to local gravity.
Main Points
  • Students should be able to predict the locations where the two hovercraft land given the assumption that they fall only under the gravitational force. They should further be able to explain the process by which they did this prediction.
  • Students should be able to plot the motion of the hovercrafts in the x and y-directions and recognize that these motions can be decomposed and solved separately. Push them to explain this.
  • If students are moving a bit more slowly, it is OK for them to only model the motion of the constant velocity hovercraft on Tuesday and to then consider the constant force hovercraft on Thursday for 15 minutes.

==Part B Steps & Timing==

  • New 4 quadrants 15 min
  • Calculate the speed of the rescue craft at the edge, from $v_{jump}$ 30 min
    • Kinematics $v_{edge}^2 = v_{jump}^2 + 2a\Delta x$ Could use from the beginning point, but the emphasis is on finding the velocity (horizontal) at the edge
    • Or, is time is short, assume $v_{edge}=v_{jump}$
    • Need to know horizontal v at the edge of the rescue craft to analyze its fall
  • Finding time to fall 45 min
    • Relaize fall time is independent of the (horizontal)velocity at the edge
    • Could have a conversation about what impacts the x component of the velocity
    • Kinematics: $\Delta y = \frac{1}{2} a t_{fall}^2$ to get fall time
  • Finding landing point from the fall time for both crafts: $x=v_{edge}*t_{fall} 60 min
  • Which craft is “safe”?
  • Plot x and y vs time; and $v_x$ and $v_y$ vs time
Teaching Points
  • The diagram can be tricky

Parts A and B are meant to be done on the same day, but in practice half of the folks do not finish part B. It's okay to spend the first part of McMurdo day 2 to complete part B. They need to do this before doing the computational part C.

Common Difficulties
  • The mathematics here can cause groups to struggle a bit because the prediction equations are vector equations and can be decomposed. Give students ample opportunity and provide enough scaffolding to help them work through those ideas.
  • The calculations can be a bit long, so having students focus on one hovercraft first can help.

Project 2: Part C: Escape from ice station McMurdo

Surprisingly enough hovercrafts are an expensive piece of kit. Your employer, the Carver Media Group, is concerned by the happenings at the McMurdo ice station and would like you to produce an accident report detailing the events after you lost control of your hovercraft. The accident report should include a detailed computational model that provides the projected motion of the runaway hovercraft.

Project 2 Solution: Part C: Escape from ice station McMurdo

In this problem students are modeling the motion of the hovercrafts as they drive off the cliff and fall onto the ground below. This is a challenging problem for many students because in this program there are two steps to the integration algorithm: (1) update momentum (velocity) with force, and (2) update position with momentum (velocity).

It is a good idea to focus students' attention on modeling a single hovercraft rather than trying to do both at the same time. And probably the simplest is the runaway hovercraft that moves with the same horizontal velocity throughout the problem.

Students will spend a lot of time trying to make sense of what the image is and where everything is located. That's fine, but make sure they get to the modeling part in fairly short order.

If python review/ information is needed before attempting this problem, it can be found in the Modeling Motion with VPython notes.

Working first with the runaway craft, we can change the values to reflect those in the problem:

#Parameters and Initial Conditions
runawaycraftv = vector(53.64,0,0)

Next, we can add in the portion of code when the runaway craft is falling ($y>0$), with no ground force:

#Calculation Loop
while runawaycraft.pos.y > 0:
    rate(500)
 
    Fgrav = runawaycraftm*g
    Fnet = Fgrav
 
    runawaycraftp = runawaycraftp + Fnet*dt
    runawaycraft.pos = runawaycraft.pos + (runawaycraftp/runawaycraftm)*dt
 
    runawaycraftMotionMap.update(t, runawaycraftp/runawaycraftm)
 
    t = t + dt
Tutor Question
  • Question: What condition are you using to regulate the motion of the craft after the cliff?
  • Expected Answer: The easiest condition to use is whenever the position of the craft is above the ground ($y>0$), since the craft will already be past the cliff ($x>0$) given the previous while loop condition.
  • Question: If the ground force was not removed, what would happen?
  • Expected Answer: The hovercraft would continue to go in a straight line.
  • Question: Where does the force of the ground come from? What significance do the white blocks hold?
  • Expected Answer: The white blocks on the screen are just pictures, the force actually comes from the vectors added into the while loop.

Now for the rescue craft, we copy over all the necessary items and change/add the values/parameters to reflect those of the problem:

#Objects
rescuecraft = sphere(pos=vector(-200,400,0), radius=10, color=color.green)
 
#Parameters and Initial Conditions
rescuecraftm = 1900
rescuecraftv = vector(116.366,0,0)
rescuecraftp = rescuecraftm*rescuecraftv
rescuecrafta = vector(0.2093,0,0)
rescuecraftF = rescuecraftm*rescuecrafta
 
#MotionMap/Graph
rescuecraftMotionMap = MotionMap(rescuecraft, tf, 5, markerScale=1, labelMarkerOrder=False, markerColor=color.orange)
 
#Calculation Loop
while rescuecraft.pos.x < 0:
    rate(500)
 
    Fgrav = rescuecraftm*g
    Fground = -Fgrav
    Fnet = Fgrav + Fground + rescuecraftF
 
    rescuecraftp = rescuecraftp + Fnet*dt
    rescuecraft.pos = rescuecraft.pos + (rescuecraftp/rescuecraftm)*dt
 
    rescuecraftMotionMap.update(t, rescuecraftp/rescuecraftm)
 
    t = t + dt
 
while rescuecraft.pos.y > 0:
    rate(500)
 
    Fgrav = rescuecraftm*g
    Fnet = Fgrav
 
    rescuecraftp = rescuecraftp + Fnet*dt
    rescuecraft.pos = rescuecraft.pos + (rescuecraftp/rescuecraftm)*dt
 
    rescuecraftMotionMap.update(t, rescuecraftp/runawaycraftm)
 
    t = t + dt
Tutor Questions
  • Tutor Question: What happens when you change the mass of the hovercrafts?
  • Expected Answer: No difference.
  • Tutor Questions: Can you explain the important physical lines of codes?
  • Expected Answer: The net forces, the update in momentum, and the update in position are all critical to this problem.
  • Tutor Questions: Are there any parts of the code that are particularly troublesome/confusing/difficult? Were there any parts that were intuitive/easy?
  • Expected Answer:
  • Tutor Question: How can you make this simulation more “real world?”
  • Expected Answer: Air resistance.
Main Points
  • Students should develop a working model of at least of the hovercrafts before the end of the class session.
  • Students should be able to explain how their code predicts the motion of this hovercraft and describe all the changes and additions that they made to the program.
  • It is worth your time if you have it, to ask students to represent the motion of the hovercraft with arrows to see how the velocity and momentum change in each direction. They can do this altering the MotionMap line of code.
  • If students have time, they should model the second hovercraft and be able to explain differences in the motion.

==Part C Steps & Timing==

  • Finishing Part B if needed: 30 min
  • Recommend to start with constant velocity cart, then duplicate/ copy&paste for accelerating cart
  • Comment code: 40 min
  • Falling $\vec{F}_{net} = \vec{F}_{grav}: 55 min
    • runawaycraft.p means momentum
    • runawaycraft.pos means position
  • Copy for rescue craft: 65 min
    • May spend some time on adding x-acceleration (x<0) or even beyond
    • Is there a significant change in the x-velocity over the final 200m? No, the fractional change will be quite small
  • Adding velocity arrows - Motion Map: 70 min
  • Questions: 85 min
  • Extension: adding air resistance: 105 min
    • This takes some time to complete, don't have them attempt if less than 10 minutes remaining
    • Need to use velocity unit vector to give direction of $-\hat{v}$
  • Second Extension Part D, launch at an angle
    • part D is hidden ask to open up if needed
    • should only do if completed air resistance first
Teaching Points and tips
  • Use Glowscript 2.9 Vpython
    • Given in the starter code and will not work with the new version
  • Comments are your friend!
  • Inexperienced coder(s) should code
    • With one code version being edited (additional computers can view via Zoom)
    • If on Zoom, make sure everyone is engaged and not doing their own thing on their computer.
  • Whiteboards and pseudocode
    • Sometimes, they get stuck. Have them write out what they want to do on the board(words and equations), then help with syntax.
  • Final code should have four while loops
    • 2 for each craft: for while y >0 (jump - as they are falling) & x<0 while they are still on top of the cliff
    • Watch for using more complicated Python moves that inexperienced coders have never seen (for, if, etc.)
  • May need to take some time to explain time updates
    • t=t+dt
    • May seem strange to novice coders, as algebraically it doesn't make sense
  • If they get to the air resistance extension, the drag equation is in the notes
Common Difficulties
  • This is a fairly complex program, that students spend a significant amount of time trying to understand. There's quite a few lines of code and they need to determine where everything is located. This can be tough especially because the shapes are drawn based on their centers and not edges.
  • Writing the code to calculate the force can cause issues as students will often (unknowingly) represent it as a scalar. Look for this.
  • The update is tough, too, because they have to write a new loop. Push students to review the previously-written loop to make sense of what it is doing and how it is being told by them to stop. The loop conditional and the process of updating the motion are both challenging for many groups.

Bonus Problem: Adding Air Resistance

The following addition of air resistance is a lengthy process. If the group does not have a reasonable amount of time to begin and make decent progress, do not push them. Rather, focus on developing concepts used in the previous tasks and ask any remaining tutor questions.

Bonus Problem: Using that the force of air resistance is $\vec{F}_{\rm air}=-bv^{2}\hat{v}$, can you incorporate this into your code?

Expected Solution: We approximated and Googled to determine $b$. We then created the force and added it to the net force for each chunk of while loop.

#Parameters and Initial Conditions
b = 0.5  #Drag coefficient
 
#Calculation loop
	Fair = -b*dot(...craftp/...craftm,...craftp/...craftm)*...craftp/mag(...craftp)
 
	Fnet = ... + Fair

Solution Code to Part C:

GlowScript 2.9 VPython
 
get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js')
 
#Window setup
scene.width = 1024
scene.height = 768
scene.center = vector(600,0,0)
 
#Objects
cliff = box(pos=vector(-100,0,0), size=vec(200,800,0), color=color.white)
ravine = box(pos=vector(245,-200, 0), size=vec(490,400,0), color=color.white)
lake = box(pos=vector(940, -200, 0), size=vec(900,400,0), color=color.blue)
runawaycraft = sphere(pos=vector(-200,400,0), radius=10, color=color.red)
rescuecraft = sphere(pos=vector(-200,400,0), radius=10, color=color.green)  # Use runaway as template to add rescue
 
#Parameters and Initial Conditions
g = vector(0,-9.81,0)
b = 0  #Drag coefficient  
 
runawaycraftm = 1500
runawaycraftv = vector(53.64,0,0)    # change velocity to calculated value from part A
runawaycraftp = runawaycraftm*runawaycraftv
 
# Add the next 5 lines for the rescue craft initialed values:
rescuecraftm = 1900
rescuecraftv = vector(116.366,0,0)
rescuecraftp = rescuecraftm*rescuecraftv
rescuecrafta = vector(0.2093,0,0)
rescuecraftF = rescuecraftm*rescuecrafta
 
#Time and time step
t=0
tf=5
dt = 0.01
 
#MotionMap/Graph
runawaycraftMotionMap = MotionMap(runawaycraft, tf, 5, markerScale=1, labelMarkerOrder=False, markerColor=color.orange)
 
# Use runaway motionmap as template for:
rescuecraftMotionMap = MotionMap(rescuecraft, tf, 5, markerScale=1, labelMarkerOrder=False, markerColor=color.orange) 
 
#Calculation Loop
while runawaycraft.pos.x < 0:
    rate(500)
 
    Fgrav = runawaycraftm*g
    Fground = -Fgrav
    Fnet = Fgrav + Fground
 
    runawaycraftp = runawaycraftp + Fnet*dt
    runawaycraft.pos = runawaycraft.pos + (runawaycraftp/runawaycraftm)*dt
 
    runawaycraftMotionMap.update(t, runawaycraftp/runawaycraftm)
 
    t = t + dt
 
# Use given while as tempate for the next 8 lines
# Modify conditional to pos.y and remove ground force
while runawaycraft.pos.y > 0:
    rate(500)
 
    Fgrav = runawaycraftm*g
    Fnet = Fgrav
 
    runawaycraftp = runawaycraftp + Fnet*dt
    runawaycraft.pos = runawaycraft.pos + (runawaycraftp/runawaycraftm)*dt
 
    runawaycraftMotionMap.update(t, runawaycraftp/runawaycraftm)
 
    t = t + dt
 
# Use the 2 working runaway while loops as template to add the following 2 resucue while loops
while rescuecraft.pos.x < 0:
    rate(500)
 
    Fgrav = rescuecraftm*g
    Fground = -Fgrav
    Fnet = Fgrav + Fground + rescuecraftF
 
    rescuecraftp = rescuecraftp + Fnet*dt
    rescuecraft.pos = rescuecraft.pos + (rescuecraftp/rescuecraftm)*dt
 
    rescuecraftMotionMap.update(t, rescuecraftp/rescuecraftm)
 
    t = t + dt
 
while rescuecraft.pos.y > 0:
    rate(500)
 
    Fgrav = rescuecraftm*g
    Fnet = Fgrav   # May include rescuecraftF here too
 
    rescuecraftp = rescuecraftp + Fnet*dt
    rescuecraft.pos = rescuecraft.pos + (rescuecraftp/rescuecraftm)*dt
 
    rescuecraftMotionMap.update(t, rescuecraftp/runawaycraftm)
 
    t = t + dt

Changes made to obtain solution of Part C:

Project 2: Part D: Escape from ice station McMurdo

The Carver Media Group is now asking for an accident report for the your hovercraft as well. They want to you simulate the events from the point at which the two hovercrafts meet to when the hovercraft reached the water, however, they want you to model the hovercraft as if it had left the cliff at angle of 27 degrees from the ground. They want this model to be in the same model as the model for the runaway craft.

Solution Code including changes made to obtain the solution for Part C with air drag and Part D adding a 27-degree launch angle:

GlowScript 2.9 VPython
get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js')
 
#Window setup
scene.width = 1024
scene.height = 768
scene.center = vector(600,0,0)
 
#Objects
cliff = box(pos=vector(-100,0,0), size=vec(200,800,0), color=color.white)
ravine = box(pos=vector(245,-200, 0), size=vec(490,400,0), color=color.white)
lake = box(pos=vector(940, -200, 0), size=vec(900,400,0), color=color.blue)
runawaycraft = sphere(pos=vector(-200,400,0), radius=10, color=color.red)
rescuecraft = sphere(pos=vector(-200,400,0), radius=10, color=color.green)  # Use runaway as template to add rescue
 
#Parameters and Initial Conditions
g = vector(0,-9.81,0)
b = 0.5  #Drag coefficient  change from zero
 
runawaycraftm = 1500
runawaycraftv = vector(53.64,0,0)    # change velocity to calculated value from part A
runawaycraftp = runawaycraftm*runawaycraftv
 
# Add the next 5 lines for the rescue craft initialed values:
rescuecraftm = 1900
rescuecraftv = vector(116.366,0,0)
rescuecraftp = rescuecraftm*rescuecraftv
rescuecrafta = vector(0.2093,0,0)
rescuecraftF = rescuecraftm*rescuecrafta
 
#Add angle of ramp-launch at upper edge of cliff (Extension part D):
thetaindegrees = 27
thetainrad = thetaindegrees*pi/180
dirlaunch = vector(cos(thetainrad),sin(thetainrad),0)
 
#Time and time step
t=0
tf=5
dt = 0.01
 
#MotionMap/Graph
runawaycraftMotionMap = MotionMap(runawaycraft, tf, 5, markerScale=1, labelMarkerOrder=False, markerColor=color.orange)
 
# Use runaway motionmap as template for:
rescuecraftMotionMap = MotionMap(rescuecraft, tf, 5, markerScale=1, labelMarkerOrder=False, markerColor=color.orange) 
 
#Calculation Loop
while runawaycraft.pos.x < 0:
    rate(500)
 
    Fgrav = runawaycraftm*g
    Fground = -Fgrav
    Fdrag = -b*runawaycraftp*mag(runawaycraftp)/(runawaycraftm)**2   #add drag force
    Fnet = Fgrav + Fground + Fdrag   #add drag force
 
    runawaycraftp = runawaycraftp + Fnet*dt
    runawaycraft.pos = runawaycraft.pos + (runawaycraftp/runawaycraftm)*dt
 
    runawaycraftMotionMap.update(t, runawaycraftp/runawaycraftm)
 
    t = t + dt
 
# Add ramp-launch angle at upper-cliff edge:
runawaycraftp = mag(runawaycraftp)*dirlaunch
 
# Use given while as tempate for the next 8 lines
# Modify conditional to pos.y and remove ground force
while runawaycraft.pos.y > 0:
    rate(500)
 
    Fgrav = runawaycraftm*g
    Fdrag = -b*runawaycraftp*mag(runawaycraftp)/(runawaycraftm)**2 #add drag force    
    Fnet = Fgrav + Fdrag         #add drag force
    runawaycraftp = runawaycraftp + Fnet*dt    
    runawaycraft.pos = runawaycraft.pos + (runawaycraftp/runawaycraftm)*dt
 
    runawaycraftMotionMap.update(t, runawaycraftp/runawaycraftm)
 
    t = t + dt
 
# Add ramp-launch angle at upper-cliff edge:
runawaycraftp = mag(runawaycraftp)*dirlaunch
 
 
# Use the 2 working runaway while loops as template to add the following 2 resucue while loops
while rescuecraft.pos.x < 0:
    rate(500)
 
    Fgrav = rescuecraftm*g
    Fground = -Fgrav
    Fdrag = -b*rescuecraftp*mag(rescuecraftp)/(rescuecraftm)**2 #add drag force 
    Fnet = Fgrav + Fground + rescuecraftF + Fdrag
 
    rescuecraftp = rescuecraftp + Fnet*dt
    rescuecraft.pos = rescuecraft.pos + (rescuecraftp/rescuecraftm)*dt
 
    rescuecraftMotionMap.update(t, rescuecraftp/rescuecraftm)
 
    t = t + dt
 
# Add ramp-launch angle at upper-cliff edge:
rescuecraftp = mag(rescuecraftp)*dirlaunch
 
while rescuecraft.pos.y > 0:
    rate(500)
 
    Fgrav = rescuecraftm*g
    Fdrag = -b*rescuecraftp*mag(rescuecraftp)/(rescuecraftm)**2 #add drag force 
    Fnet = Fgrav + Fdrag   #add drag force  
 
    rescuecraftp = rescuecraftp + Fnet*dt
    rescuecraft.pos = rescuecraft.pos + (rescuecraftp/rescuecraftm)*dt
 
    rescuecraftMotionMap.update(t, rescuecraftp/runawaycraftm)
 
    t = t + dt

Changes made to the solution for Part C, adding air drag (boxed in red) and Part D adding a 27-degree launch angle (boxed in purple):

  • course_planning/183_projects/f21_week_1_escape_from_ice_station_mcmurdo.txt
  • Last modified: 2024/01/15 21:39
  • by hallstein