course_planning:183_projects:s23_week_3_geostationary_orbit

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:183_projects:s23_week_3_geostationary_orbit [2023/01/25 17:46] hallsteincourse_planning:183_projects:s23_week_3_geostationary_orbit [2023/10/18 01:20] (current) hallstein
Line 102: Line 102:
   * **Tutor Question:**  If you added in another body, what two forces would constitute the net force acting on the satellite?   * **Tutor Question:**  If you added in another body, what two forces would constitute the net force acting on the satellite?
   * **Expected Answer:**  $\vec{F}_{\rm net}=-GM_{1}m\hat{r}_{1}/r_{1}^{2}-GM_{2}m\hat{r}_{2}/r_{2}^{2}$   * **Expected Answer:**  $\vec{F}_{\rm net}=-GM_{1}m\hat{r}_{1}/r_{1}^{2}-GM_{2}m\hat{r}_{2}/r_{2}^{2}$
- 
-{{course_planning:geostationary_part_1_questions.png}} 
  
 </WRAP> </WRAP>
Line 143: 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 the vector calculations can be challenging.+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's lots to play with once they get a working code. Ask them to demonstrate how they know it's circular. See what they come up with, but you can push them to think about plotting the separation between the Earth and the satellite. Make sure you have them test different time steps when they do that. You can have them check it works for an elliptical orbit.  There's lots to play with once they get a working code. Ask them to demonstrate how they know it's circular. See what they come up with, but you can push them to think about plotting the separation between the Earth and the satellite. Make sure you have them test different time steps when they do that. You can have them check it works for an elliptical orbit. 
Line 150: Line 148:
 </WRAP> </WRAP>
  
-First we want to input our radius of geostationary orbit and the necessary velocity, as well as any constants:+<WRAP tip> 
 +== Tutor Questions == 
 +  * **Question:** Can you sketch the satellite in its geostationary orbit about Earth?   Include the net force acting on the object and the separation vector. 
 +  * **Expected Answer:**... 
 +  * **Question:** Where does the separation vector point? From where to where?   
 +  * **Expected Answer:** It points from the center of Earth to the satellite. 
 +  * **Question:** In what direction does the net force vector acting on the satellite point?   
 +  * **Expected Answer:** The force points toward the center of Earth. 
 +   
 +  * **Question:** How are $\vec{r}$, $\left | \vec{r} \right |$ and $\hat{r}$ related? 
 +  * **Expected Answer:** $\vec{r} = \left | \vec{r} \right | \cdot \hat{r}$ 
 + 
 +</WRAP> 
 + 
 + 
 +We want to input our radius of geostationary orbit and the necessary velocity, as well as any constants:
 <code Python> <code Python>
 #Objects #Objects
Line 163: Line 176:
  
 Next, we want to incorporate the force due to gravity.  Change the given null vector to the required gravitational force: Next, we want to incorporate the force due to gravity.  Change the given null vector to the required gravitational force:
 +<WRAP tip>
 +== Tutor Question ==
 +  * **Question:** How can you enter the magnitude of a vector into the code?
 +  * **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.
 + </WRAP>
 +
 <code Python> <code Python>
 #Calculation Loop #Calculation Loop
Line 185: Line 204:
  
 <WRAP alert> <WRAP alert>
-The addition of the non-constant Newtonian force is challenging for students.  If the group is struggling to correctly model it, do not push them to add in a graph. Rather, focus on correctly completing the previous tasks and ask any remaining tutor questions.+The addition of the non-constant Newtonian force is challenging for students.  If the group is struggling to correctly model it, do not push them to add a graph. Rather, focus on correctly completing the previous tasks and ask any remaining tutor questions.
 </WRAP> </WRAP>
  
 <WRAP tip> <WRAP tip>
 ==Tutor Questions:== ==Tutor Questions:==
-  * **Question:**  How can you prove that the orbit is actually circular? +   * **Question:**  Can you simulate other trajectories with your program?
-  * **Expected Answer:**   +
-Aside from just eyeballing it, we can add in a graph of the distance from the center of Earth! +
-<code python> +
-#MotionMap/Graph +
-separationGraph = PhysGraph(numPlots=1) +
- +
-#Calculation Loop +
- separationGraph.plot(t,mag(Satellite.pos)) +
-</code> +
- +
-  * **Question:**  Can you simulate other trajectories with your program?+
   * **Expected Answer:**  We can change the initial conditions of radius and velocity to show this.   * **Expected Answer:**  We can change the initial conditions of radius and velocity to show this.
  
Line 210: Line 218:
   * **Expected Answer:**  It is the step in time that passes every loop of the calculation loop.  Increasing the time step makes for a "rougher" approximation to the real world phenomenon.   * **Expected Answer:**  It is the step in time that passes every loop of the calculation loop.  Increasing the time step makes for a "rougher" approximation to the real world phenomenon.
  
-{{course_planning:georobitconceptualq2.png}}+ * **Question:**  How can you prove that the orbit is actually circular? 
 +  * **Expected Answer:**  Aside from just eyeballing it, we can add in a graph of the distance from the center of Earth!  
 +Part C includes adding this graph: 
 + 
 +<code python> 
 +#MotionMap/Graph 
 +separationGraph = PhysGraph(numPlots=1) 
 + 
 +#Calculation Loop 
 + separationGraph.plot(t,mag(Satellite.pos)) 
 +</code>
  
 </WRAP> </WRAP>
Line 218: 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., the momentum of the satellite, etc.).
 </WRAP> </WRAP>
  
Line 232: Line 250:
 </WRAP> </WRAP>
  
 +Working code for part B:
 <code> <code>
 GlowScript 2.9 VPython GlowScript 2.9 VPython
 + 
 get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js') get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js')
 + 
 #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,0,0), radius=6.4e6, color=color.blue) Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.blue)
-Satellite = sphere(pos=vector(42164e3, 0,0), radius=1e6, color=color.red, make_trail=True) +Satellite = sphere(pos=vector(42164e3, 0,0), radius=1e6, color=color.red, make_trail=True)   #modify position of satellite 
 + 
 #Parameters and Initial Conditions #Parameters and Initial Conditions
-mSatellite = 15e3 +mSatellite = 15e3   # edit mass of the satellite 
-pSatellite = mSatellite*vector(0,3073,0) +pSatellite = mSatellite*vector(0,3073,0) #edit momentum of the satellite 
-G = 6.67e-11 +G = 6.67e-11   # add universal gravitational constant 
-mEarth = 5.97e24 +mEarth = 5.97e24  # add mass of Earth 
 + 
 #Time and time step #Time and time step
 t = 0 t = 0
 tf = 60*60*24 tf = 60*60*24
 dt = 1 dt = 1
 + 
 +#MotionMap/Graph
 +SatelliteMotionMap = MotionMap(Satellite, tf, 20, markerScale=2000, labelMarkerOrder=False)
 +FnetMotionMap = MotionMap(Satellite, tf, 20, markerScale=2000, labelMarkerOrder=False)   # add Fnet force arrows - also need to add in loop)
 + 
 + 
 +#Calculation Loop
 +while t < tf:
 +    rate(10000)
 + 
 +    Fgrav = -G*mSatellite*mEarth*Satellite.pos/(mag(Satellite.pos)**3) # Add Fgrav change Fnet
 +    Fnet = Fgrav                                                       # change Fnet from zero
 + 
 +    pSatellite = pSatellite + Fnet*dt
 +    Satellite.pos = Satellite.pos + (pSatellite/mSatellite)*dt
 + 
 +    SatelliteMotionMap.update(t, pSatellite/mSatellite)
 + 
 +    FnetMotionMap.update(t, Fnet)  # Add Fnet vector arrows
 +    t = t + dt
 + 
 +    #Earth Rotation (IGNORE)
 +    theta = 7.29e-5*dt
 +    Earth.rotate(angle=theta, axis=vector(0,0,1), origin=Earth.pos)
 +</code>
  
 +Changes made to the given code:
 +
 +{{course_planning:project_solutions:project_3_code_b.png}}
 +
 +====== 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.    He seems particularly concerned the distance of the satellite from Earth not very more than $\pm$ 1%.  Graphs of its distance from Earth and the magnitude of the net force acting on it may convince him.
 +
 +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).  One outside the while loop and the second inside as the variable being plotted on the vertical axis changes with time:
 +
 +Outside the while loop, add: graphExample = PhysGraph(numPlots=1)
 +
 +Inside the while loop, add: graphExample.plot(t, mEarth)
 +
 +<WRAP tip>
 +== Tutor Questions ==
 +  * **Question:** The plotted distance is varying with time.  Is this a concern?  WHy is this?
 +  * **Expected Answer:**  It is not a concern.  We inputted given values to a couple of significant figures and the variations are just a small fraction of the distance...
 +</WRAP>
 +
 +
 +
 +====== Project 3: Part D: Geostationary orbit ======
 +
 +On a single graph, plot both the x-component of the satellite's momentum and the x-component of the net force acting on the satellite.
 +
 +<WRAP tip>
 +== Tutor Questions ==
 +  * **Question:** Why does it seem as though the net force is zero?
 +  * **Expected Answer:**  It looks that way because the size of the force plotted by Python is several orders of magnitude smaller than the size of the plotted momentum.  We fixed this by adding a scale and plotting the force in units of $10^4$ N
 +  * **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.
 +</WRAP>
 +Solution code for parts C and D
 +
 +<code>
 +GlowScript 2.9 VPython
 + 
 +get_library('https://cdn.rawgit.com/PERLMSU/physutil/master/js/physutil.js')
 + 
 +#Window setup
 +scene.range=7e7
 +scene.width = 1024
 +scene.height = 760
 + 
 +#Objects
 +Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.blue)
 +Satellite = sphere(pos=vector(42164e3, 0,0), radius=1e6, color=color.red, make_trail=True)   #modify position of satellite
 + 
 +#Parameters and Initial Conditions
 +mSatellite = 15e3   # edit mass of the satellite
 +pSatellite = mSatellite*vector(0,3073,0) #edit momentum of the satellite
 +G = 6.67e-11   # add universal gravitational constant
 +mEarth = 5.97e24  # add mass of Earth
 + 
 +#Time and time step
 +t = 0
 +tf = 60*60*24
 +dt = 1
 + 
 #MotionMap/Graph #MotionMap/Graph
 SatelliteMotionMap = MotionMap(Satellite, tf, 20, markerScale=2000, labelMarkerOrder=False) SatelliteMotionMap = MotionMap(Satellite, tf, 20, markerScale=2000, labelMarkerOrder=False)
-FnetMotionMap = MotionMap(Satellite, tf, 20, markerScale=2000, labelMarkerOrder=False) +FnetMotionMap = MotionMap(Satellite, tf, 20, markerScale=2000, labelMarkerOrder=False)   add Fnet force arrows - also need to add in loop) 
-#separationGraph = PhysGraph(numPlots=1) + 
-f1=series()+graphSeparation = PhysGraph(numPlot=1)   # initialize the magnitude of the separation vector vs time plot 
 +graphFnet PhysGraph(numPlots=1  # initialize the magnitude of the net force vs time plot
  
 +graphpF = PhysGraph(numPlots=2)   # initialize the x componets of p and Fnet vs time plot
  
 + 
 + 
 #Calculation Loop #Calculation Loop
 while t < tf: while t < tf:
     rate(10000)     rate(10000)
- +  
-    Fgrav = -G*mSatellite*mEarth*Satellite.pos/(mag(Satellite.pos)**3) +    Fgrav = -G*mSatellite*mEarth*Satellite.pos/(mag(Satellite.pos)**3) # Add Fgrav change Fnet 
-    Fnet = Fgrav +    Fnet = Fgrav                                                       # change Fnet from zero 
 + 
     pSatellite = pSatellite + Fnet*dt     pSatellite = pSatellite + Fnet*dt
     Satellite.pos = Satellite.pos + (pSatellite/mSatellite)*dt     Satellite.pos = Satellite.pos + (pSatellite/mSatellite)*dt
 + 
     SatelliteMotionMap.update(t, pSatellite/mSatellite)     SatelliteMotionMap.update(t, pSatellite/mSatellite)
-     +  
-    FnetMotionMap.update(t, Fnet)+    FnetMotionMap.update(t, Fnet)  # Add Fnet vector arrows
     #separationGraph.plot(t,mag(mSatellite))     #separationGraph.plot(t,mag(mSatellite))
-    f1.plot(t,mag(Satellite.pos)) +    graphSeparation.plot(t,mag(Satellite.pos))  # update magnitude of sep vector vs time plot 
 +    graphFnet.plot(t,mag(Fnet))    # update magnitude of Fnet vs time plot 
 +    scale=1.0E4   # add scale to make fluctuations in Fx visible (units of 10^-4 N) 
 +    graphpF.plot(t,pSatellite.x,scale*Fnet.x)   # update x-components of Fnet and p vs time 
 + 
     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, axis=vector(0,0,1), origin=Earth.pos)     Earth.rotate(angle=theta, axis=vector(0,0,1), origin=Earth.pos)
-</code>+</code>     
 + 
 +Modification of solution to part B to get |r| vs t, |Fnet| vs t and Fnet,x and P,x vs t: 
 + 
 +{{course_planning:project_solutions:project_3_code_cd.png}} 
  • course_planning/183_projects/s23_week_3_geostationary_orbit.1674668793.txt.gz
  • Last modified: 2023/01/25 17:46
  • by hallstein