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 23:05] – [Code] obsniukm | course_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, | + | hovercraft = sphere(pos=vector(-200, |
#Parameters and Initial Conditions | #Parameters and Initial Conditions | ||
Line 48: | Line 48: | ||
# | # | ||
- | while runawaycraft.pos.x < 0: | + | while hovercraft.pos.x < 0: |
- | rate(500) | + | Fgrav = hovercraftm*g |
+ | Fground = -Fgrav | ||
+ | Fnet = Fgrav + Fground | ||
- | Fgrav | + | hovercraftp |
- | Fground | + | |
- | Fnet = Fgrav + Fground | + | |
- | hovercraftp = hovercraftp + Fnet*dt | + | hovercraftMotionMap.update(t, hovercraftp/ |
- | 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: | ||
+ | </ |