course_planning:computation:scratch_work

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
course_planning:computation:scratch_work [2016/03/12 23:05] – [Code] obsniukmcourse_planning:computation:scratch_work [2016/03/25 18:40] (current) – [Code] obsniukm
Line 30: Line 30:
 <code python> <code python>
 #Objects #Objects
-hovercraft = sphere(pos=vector(-200,400,0), radius=10, color=color.red)+hovercraft = sphere(pos=vector(-200,400,0), radius=1)
  
 #Parameters and Initial Conditions #Parameters and Initial Conditions
Line 48: Line 48:
  
 #Calculation Loop #Calculation Loop
-while runawaycraft.pos.x < 0: +while hovercraft.pos.x < 0: 
- rate(500)+    Fgrav = hovercraftm*g 
 +    Fground = -Fgrav 
 +    Fnet = Fgrav + Fground
  
- Fgrav runawaycraftm*g +    hovercraftp hovercraftp + Fnet*dt 
- Fground -Fgrav +    hovercraft.pos hovercraft.pos (hovercraftp/hovercraftm)*dt
- Fnet = Fgrav Fground+
  
- hovercraftp = hovercraftp + Fnet*dt +    hovercraftMotionMap.update(t, hovercraftp/hovercraftm)
- hovercraft.pos = hovercraft.pos + (hovercraftp/hovercraftm)*dt+
  
- hovercraftMotionMap.update(t, hovercraftp/hovercraftm) +    t = t + dt
- +
- t = t + dt+
 </code> </code>
 +
 +<WRAP tip>
 +== 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, these are only average numbers, not instantaneous.  In order to get more "exact" numbers, we would need more data.
 +
 +  * **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).
 +</WRAP>
  • course_planning/computation/scratch_work.1457823926.txt.gz
  • Last modified: 2016/03/12 23:05
  • by obsniukm