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:03] – [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 | ||
| - | runawaycraft | + | hovercraft |
| #Parameters and Initial Conditions | #Parameters and Initial Conditions | ||
| g = vector(0, | g = vector(0, | ||
| - | runawaycraftm | + | hovercraftm |
| - | runawaycraftv | + | hovercraftv |
| - | runawaycraftp | + | hovercraftp |
| #Time and time step | #Time and time step | ||
| Line 45: | Line 45: | ||
| # | # | ||
| - | runawaycraftMotionMap | + | hovercraftMotionMap |
| # | # | ||
| - | 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 | + | |
| - | runawaycraftp = runawaycraftp + Fnet*dt | + | hovercraftMotionMap.update(t, hovercraftp/hovercraftm) |
| - | runawaycraft.pos = runawaycraft.pos + (runawaycraftp/runawaycraftm)*dt | + | |
| - | runawaycraftMotionMap.update(t, | + | |
| - | + | ||
| - | t = t + dt | + | |
| </ | </ | ||
| + | |||
| + | <WRAP tip> | ||
| + | == Tutor Questions == | ||
| + | * **Question: | ||
| + | * **Expected Answer: | ||
| + | |||
| + | * **Question: | ||
| + | * **Expected Answer: | ||
| + | |||
| + | * **Question: | ||
| + | * **Expected Answer: | ||
| + | |||
| + | * **Questions: | ||
| + | * **Expected Answer: | ||
| + | |||
| + | * **Questions: | ||
| + | * **Expected Answer: | ||
| + | </ | ||