


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



PHYSICS 113 – Recitation Assignment 3
Name
October 10, 2007
Today’s recitation will involve the general form of gravity, and, in particular, you will show using a computer that two bodies will orbit one another in an elliptical orbit. Moreover, you will use numerics to determine the optimal speed for a particle traveling in a circular orbit. Note, for simplicity, when I use the symbol ⊙, it means “of the sun”, and when I use ⊕, it means, “of the earth.”
You may complete this in class. However, if you are unable to do so, it is expected that you complete this for recitation next time. Remember to email both programs to Travis when you are done, and be sure to put your name in as a comment in both.
It is also strongly recommended that you test your code after each step in the process.
If you have any questions, please ask.
New Concepts:
Physical
Computational
In the first part of the assignment, we will model the earth-sun system. Since the sun is much more massive than the earth, we will be able to make the assumption that the sun is stationary.
from visual import *
at the top.
scene.range=2e scene.autoscale=
The first line makes the viewscreen large enough to see a bit beyond the “orbit” of the earth, and the second command tells the code not to automatically resize the picture if the earth flies out of the field of view. Start by making the radii the true values from our solar system (look this up using google or in your textbook). Too small? Maybe you need to make them bigger.
∆~r = ~p/m∆t
Well, at each timestep, you have to evolve the position of the earth, according to this formula. Put in the following additions to your code:
yr=3.15e dt=0.02*yr t=
while (t < 2yr) : rate (10) earth.pos=earth.pos+dtearth.p/earth.m t=t+dt
The first three commands tell the code how many seconds there are in a year. The second tells it what the value of ∆t is. The third tells it to “start the clock” at t=0.
F^ ~⊕ = − GM⊙M⊕ r^3 sun−earth
(~r⊕ − ~r⊙)
where G = 6. 67 × 10 −^11 N m 2 kg^2 is the gravitational constant. You should define the force on the earth as:
for mystar in (star): mystar.pos=mystar.pos+mystar.p/star.m*dt
for example, along with any other calculations which need to be done on all stars. Note also that this loop should be “nested” (doubly indented) if it is under the time loop.