Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
course_planning:computation:scratch_work [2016/03/12 22:44] – [Project 2: Part C: Escape from ice station McMurdo] obsniukm | course_planning:computation:scratch_work [2016/03/25 18:40] (current) – [Code] obsniukm | ||
---|---|---|---|
Line 22: | Line 22: | ||
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. | 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. | ||
- | <WRAP download | + | <WRAP download |
+ | |||
+ | |||
+ | |||
+ | ====== Code ====== | ||
+ | |||
+ | <code python> | ||
+ | #Objects | ||
+ | hovercraft = sphere(pos=vector(-200, | ||
+ | |||
+ | #Parameters and Initial Conditions | ||
+ | g = vector(0, | ||
+ | |||
+ | hovercraftm = 1500 | ||
+ | hovercraftv = vector(53.64, | ||
+ | hovercraftp = runawaycraftm*runawaycraftv | ||
+ | |||
+ | #Time and time step | ||
+ | t=0 | ||
+ | tf=10 | ||
+ | dt = 0.01 | ||
+ | |||
+ | # | ||
+ | hovercraftMotionMap = MotionMap(hovercraft, | ||
+ | |||
+ | # | ||
+ | while hovercraft.pos.x < 0: | ||
+ | Fgrav = hovercraftm*g | ||
+ | Fground = -Fgrav | ||
+ | Fnet = Fgrav + Fground | ||
+ | |||
+ | hovercraftp = hovercraftp + Fnet*dt | ||
+ | hovercraft.pos = hovercraft.pos + (hovercraftp/ | ||
+ | |||
+ | hovercraftMotionMap.update(t, | ||
+ | |||
+ | t = t + dt | ||
+ | </ | ||
+ | |||
+ | <WRAP tip> | ||
+ | == Tutor Questions == | ||
+ | * **Question: | ||
+ | * **Expected Answer: | ||
+ | |||
+ | * **Question: | ||
+ | * **Expected Answer: | ||
+ | |||
+ | * **Question: | ||
+ | * **Expected Answer: | ||
+ | |||
+ | * **Questions: | ||
+ | * **Expected Answer: | ||
+ | |||
+ | * **Questions: | ||
+ | * **Expected Answer: | ||
+ | </ |