Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

link to code: https://www.dropbox.com/s/jc2k0u96khz7llz/25V%20EarthMoon.py?dl=0

ID: 3279377 • Letter: L

Question

link to code:

https://www.dropbox.com/s/jc2k0u96khz7llz/25V%20EarthMoon.py?dl=0

If you remember, the Force of Gravity is F vector _G GMm/r^2 (-r) We'll use this relation throughout the lab. While the true movement of the stars is slightly elliptical, we'11 start out by assuming all motion is purely circular. You will need to make sure you have the right input distances and velocities for your planets if you want them to maintain a circular orbit. In LMS you will find the sample code that should already run. Any line that begins with a # (hashtag) is a comment. Those lines of code will tell you what the below lines of code actually do. The code itself should be somewhat readable in combination with the comments. This code starts out with the Moon orbiting the Earth, with all values except for the radius of each sphere being roughly scientifically correct. It will occasionally print out the total momentum (P vector_sys) of the system and the total angular momentum (L vector_sys) of the system. Note that both are currently non-zero. Currently, there is only one force on any object, and that's Earth's pull of the Moon. But we know that the Moon pulls the Earth just as well. So we'll have to code in that. In the same while loop, add in code that will make the Earth experience the same force but in an opposite direction that the Moon does and add in the kinematics the Earth feels. You'll notice that the code prints out the Angular Momentum L vector and the Linear Momentum p vector of the system. Once you program in both forces, you'll notice that the Moon/Earth system will move in a line over time. Determine what velocity you must give the Earth to ensure the total momentum of the system is zero (or at least many orders of magnitude smaller than what you had). Once you do this, does your system move over time? Save a new file as firstnameLastname.threeBody.py In the grim future of mankind we have decided to pull Pluto closer to be Earth's second moon. Create Pluto and have it be 8 * 10^8m away from earth. Each celestial body needs to feel a force from the other two different bodies in order for the simulation to be correct. You also need to make sure that the total momentum of the system is effectively zero (and constant) and the angular momentum of the system is constant. Save a new file as firstnameLastname_fourBody.py Earth's Moon (Luna) is now feeling not so special because of Pluto. Let's make Deimos 4 * 10^7m from Luna. This should give us Luna and Pluto orbiting the Earth, and the Deimos orbiting Luna. This should be a completely accurate simulation with the only inaccuracies being the time step and precision for any inputted values. Think about what this means in the context of forces, momentum, and angular momentum. If you didn't take Physics 3A or 3B from me last semester, you do not have to do this part (but you always can).

Explanation / Answer

For the two body case
Force of gravitation on Earth = GMm(-r')/r^2
here m is mass of moon, M is mass of earth, r is distance of earth from moon, r' is unit vector along the line joining moon and earth towards the moon
similiarly
Force of gravitation on Moon = GMm(r')/r^2 [ towards earth]

now consider that the center of mass of moon earth system is at a distance d form the moon, r - d from earth
then angular momentum about this point has to be 0, and the system is rotating about this point

so let velocity of moon be v and that of earth be V
mv^2/(d) = GMm/r^2 [ from newtons law, equating centripital force with gravitation]
v^2 = GM*d/r^2

similiarly
V^2 = Gm*(r - d)/r^2

also from definition of center of mass
M*(r - d) = md
Mr = md + Md
d = Mr/(m + M)

so v^2 = GM^2/r(m + M)
V^2 = Gm(r - Mr/(m + M))/r^2 = Gm^2/r*(m + M)


similiarly for three body case

we assume that the three bodies are in line, with central body being the most massive
we find center of mass of the system, assume that everything rotates around it, Add up gravitational attraction on every body due to the other two, equate it with centripital forcde on the body about the center of mass and find its velocity