Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
course_planning:183_projects:s23_week_3_geostationary_orbit [2023/01/25 17:37] – hallstein | course_planning:183_projects:s23_week_3_geostationary_orbit [2023/10/18 01:20] (current) – hallstein | ||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | [[:183_projects: | + | [[183_projects: |
- | [[course_planning: | + | |
<WRAP info> | <WRAP info> | ||
Line 103: | Line 102: | ||
* **Tutor Question: | * **Tutor Question: | ||
* **Expected Answer: | * **Expected Answer: | ||
- | |||
- | {{course_planning: | ||
</ | </ | ||
Line 144: | Line 141: | ||
<WRAP tip> | <WRAP tip> | ||
- | This programming problem requires students to put in the correct initial conditions from Tuesday, but also to model the gravitational force appropriately (i.e., translate the equation to code). This is tough for some groups because | + | This programming problem requires students to put in the correct initial conditions from Tuesday, but also to model the gravitational force appropriately (i.e., translate the equation to code). This is tough for some groups because vector calculations can be challenging. |
There' | There' | ||
Line 151: | Line 148: | ||
</ | </ | ||
- | First we want to input our radius of geostationary orbit and the necessary velocity, as well as any constants: | + | <WRAP tip> |
+ | == Tutor Questions == | ||
+ | * **Question: | ||
+ | * **Expected Answer: | ||
+ | * **Question: | ||
+ | * **Expected Answer:** It points from the center of Earth to the satellite. | ||
+ | * **Question: | ||
+ | * **Expected Answer:** The force points toward the center of Earth. | ||
+ | |||
+ | * **Question: | ||
+ | * **Expected Answer:** $\vec{r} = \left | \vec{r} \right | \cdot \hat{r}$ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | We want to input our radius of a geostationary orbit and the necessary velocity, as well as any constants: | ||
<code Python> | <code Python> | ||
#Objects | #Objects | ||
Line 164: | Line 176: | ||
Next, we want to incorporate the force due to gravity. | Next, we want to incorporate the force due to gravity. | ||
+ | <WRAP tip> | ||
+ | == Tutor Question == | ||
+ | * **Question: | ||
+ | * **Expected Answer** In the notes and in the pre-class homework we used mag(), so we will try using mag(Satellite.pos) here for the magnitude of our separation vector. | ||
+ | </ | ||
+ | |||
<code Python> | <code Python> | ||
# | # | ||
Line 186: | Line 204: | ||
<WRAP alert> | <WRAP alert> | ||
- | The addition of the non-constant Newtonian force is challenging for students. | + | The addition of the non-constant Newtonian force is challenging for students. |
</ | </ | ||
<WRAP tip> | <WRAP tip> | ||
==Tutor Questions: | ==Tutor Questions: | ||
- | * **Question: | + | * **Question: |
- | * **Expected Answer: | + | |
- | Aside from just eyeballing it, we can add in a graph of the distance from the center of Earth! | + | |
- | <code python> | + | |
- | # | + | |
- | separationGraph = PhysGraph(numPlots=1) | + | |
- | + | ||
- | # | + | |
- | separationGraph.plot(t, | + | |
- | </ | + | |
- | + | ||
- | | + | |
* **Expected Answer: | * **Expected Answer: | ||
Line 211: | Line 218: | ||
* **Expected Answer: | * **Expected Answer: | ||
- | {{course_planning:georobitconceptualq2.png}} | + | * **Question:** How can you prove that the orbit is actually circular? |
+ | * **Expected Answer: | ||
+ | Part C includes adding this graph: | ||
+ | |||
+ | <code python> | ||
+ | # | ||
+ | separationGraph = PhysGraph(numPlots=1) | ||
+ | |||
+ | # | ||
+ | separationGraph.plot(t, | ||
+ | </ | ||
</ | </ | ||
Line 219: | Line 236: | ||
* Groups should have developed a working code that models any gravitational orbit around the Earth and be able to explain what and how they did it. | * Groups should have developed a working code that models any gravitational orbit around the Earth and be able to explain what and how they did it. | ||
- | * For groups that get through this part (it's tough for many groups), they should check that the orbit is circular and explain that and they should add arrows to represent different physical quantities (i.e., momentum of the satellite, etc.). | + | * For groups that get through this part (it's tough for many groups), they should check that the orbit is circular and explain that and they should add arrows to represent different physical quantities (i.e., |
</ | </ | ||
Line 233: | Line 250: | ||
</ | </ | ||
- | < | + | Working code for part B: |
+ | < | ||
GlowScript 2.9 VPython | GlowScript 2.9 VPython | ||
+ | |||
get_library(' | get_library(' | ||
+ | |||
#Window setup | #Window setup | ||
scene.range=7e7 | scene.range=7e7 | ||
scene.width = 1024 | scene.width = 1024 | ||
scene.height = 760 | scene.height = 760 | ||
+ | |||
#Objects | #Objects | ||
Earth = sphere(pos=vector(0, | Earth = sphere(pos=vector(0, | ||
- | Satellite = sphere(pos=vector(42164e3, | + | Satellite = sphere(pos=vector(42164e3, |
+ | |||
#Parameters and Initial Conditions | #Parameters and Initial Conditions | ||
- | mSatellite = 15e3 | + | mSatellite = 15e3 # edit mass of the satellite |
- | pSatellite = mSatellite*vector(0, | + | pSatellite = mSatellite*vector(0, |
- | G = 6.67e-11 | + | G = 6.67e-11 |
- | mEarth = 5.97e24 | + | mEarth = 5.97e24 |
+ | |||
#Time and time step | #Time and time step | ||
t = 0 | t = 0 | ||
tf = 60*60*24 | tf = 60*60*24 | ||
dt = 1 | dt = 1 | ||
+ | |||
+ | # | ||
+ | SatelliteMotionMap = MotionMap(Satellite, | ||
+ | FnetMotionMap = MotionMap(Satellite, | ||
+ | |||
+ | |||
+ | # | ||
+ | while t < tf: | ||
+ | rate(10000) | ||
+ | |||
+ | Fgrav = -G*mSatellite*mEarth*Satellite.pos/ | ||
+ | Fnet = Fgrav # change Fnet from zero | ||
+ | |||
+ | pSatellite = pSatellite + Fnet*dt | ||
+ | Satellite.pos = Satellite.pos + (pSatellite/ | ||
+ | |||
+ | SatelliteMotionMap.update(t, | ||
+ | |||
+ | FnetMotionMap.update(t, | ||
+ | t = t + dt | ||
+ | |||
+ | #Earth Rotation (IGNORE) | ||
+ | theta = 7.29e-5*dt | ||
+ | Earth.rotate(angle=theta, | ||
+ | </ | ||
+ | Changes made to the given code: | ||
+ | |||
+ | {{course_planning: | ||
+ | |||
+ | ====== Project 3: Part C: Geostationary orbit ====== | ||
+ | |||
+ | While you have continued to impress Carver, he remains unsure about the size of the force acting on the satellite and its distance from Earth. | ||
+ | |||
+ | The syntax you need to work with in order to include a graph involves two lines of code(mass of Earth vs time is given as an example). | ||
+ | |||
+ | Outside the while loop, add: graphExample = PhysGraph(numPlots=1) | ||
+ | |||
+ | Inside the while loop, add: graphExample.plot(t, | ||
+ | |||
+ | <WRAP tip> | ||
+ | == Tutor Questions == | ||
+ | * **Question: | ||
+ | * **Expected Answer: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Project 3: Part D: Geostationary orbit ====== | ||
+ | |||
+ | On a single graph, plot both the x-component of the satellite' | ||
+ | |||
+ | <WRAP tip> | ||
+ | == Tutor Questions == | ||
+ | * **Question: | ||
+ | * **Expected Answer: | ||
+ | * **Question** From the plotted graph, what is the relationship between Fnet,x and p,x? | ||
+ | * **Expected Answer** When Fnet,x is at an extreme value, p,x is zero; when Fnet,x is zero, p,x is at an extreme value. | ||
+ | </ | ||
+ | Solution code for parts C and D | ||
+ | |||
+ | < | ||
+ | GlowScript 2.9 VPython | ||
+ | |||
+ | get_library(' | ||
+ | |||
+ | #Window setup | ||
+ | scene.range=7e7 | ||
+ | scene.width = 1024 | ||
+ | scene.height = 760 | ||
+ | |||
+ | #Objects | ||
+ | Earth = sphere(pos=vector(0, | ||
+ | Satellite = sphere(pos=vector(42164e3, | ||
+ | |||
+ | #Parameters and Initial Conditions | ||
+ | mSatellite = 15e3 # edit mass of the satellite | ||
+ | pSatellite = mSatellite*vector(0, | ||
+ | G = 6.67e-11 | ||
+ | mEarth = 5.97e24 | ||
+ | |||
+ | #Time and time step | ||
+ | t = 0 | ||
+ | tf = 60*60*24 | ||
+ | dt = 1 | ||
+ | |||
# | # | ||
SatelliteMotionMap = MotionMap(Satellite, | SatelliteMotionMap = MotionMap(Satellite, | ||
- | FnetMotionMap = MotionMap(Satellite, | + | FnetMotionMap = MotionMap(Satellite, |
- | #separationGraph | + | |
- | f1=series() | + | graphSeparation |
+ | graphFnet | ||
+ | graphpF = PhysGraph(numPlots=2) | ||
+ | |||
+ | |||
# | # | ||
while t < tf: | while t < tf: | ||
rate(10000) | rate(10000) | ||
- | + | ||
- | Fgrav = -G*mSatellite*mEarth*Satellite.pos/ | + | Fgrav = -G*mSatellite*mEarth*Satellite.pos/ |
- | Fnet = Fgrav | + | Fnet = Fgrav # change Fnet from zero |
+ | |||
pSatellite = pSatellite + Fnet*dt | pSatellite = pSatellite + Fnet*dt | ||
Satellite.pos = Satellite.pos + (pSatellite/ | Satellite.pos = Satellite.pos + (pSatellite/ | ||
+ | |||
SatelliteMotionMap.update(t, | SatelliteMotionMap.update(t, | ||
- | | + | |
- | FnetMotionMap.update(t, | + | FnetMotionMap.update(t, |
# | # | ||
- | | + | |
+ | graphFnet.plot(t, | ||
+ | scale=1.0E4 | ||
+ | graphpF.plot(t, | ||
+ | |||
t = t + dt | t = t + dt | ||
+ | |||
#Earth Rotation (IGNORE) | #Earth Rotation (IGNORE) | ||
theta = 7.29e-5*dt | theta = 7.29e-5*dt | ||
Earth.rotate(angle=theta, | Earth.rotate(angle=theta, | ||
- | </ | + | </ |
+ | |||
+ | Modification of solution to part B to get |r| vs t, |Fnet| vs t and Fnet,x and P,x vs t: | ||
+ | |||
+ | {{course_planning: |