PHYS 252

Always hand in:
  1. written solutions to any questions
  2. a paper print-out of well-commented code. Include a multiline comment at the top of your code with (i) the assignment name, (ii) your name, and (iii) the date you handed in all elements of the assignment
  3. paper print-out of output (graph or text)
  4. also, e-mail me (y-lithwick@northwestern.edu) the code with your name and the exercise number in the subject line

Prologue

For this assignment, you will need four formulas describing the Keplerian orbit of a test particle around the Sun:

  1. Its radius r versus angle θ is given by the ellipse:

    where a is the semimajor axis, e is the eccentricity, and θE is the orientation of the ellipse; specifically, it gives the angle of closest approach to the Sun ("periapse").
  2. Its energy per unit mass is

    where MS is the Sun's mass.
  3. Its angular momentum per unit mass is
  4. Its orbital period is

Note that energy and angular momentum per unit mass are defined as


where vx and vy are the Cartesian components of the velocity, v = ( vx2 + vy2)1/2, and x = r cos(θ), and y = r sin(θ)

Assignment #9
[10 pts due 2pm, May 3]

  1. Write a code integrating the equations of motion for a test particle orbiting the Sun.

    Use 4th-order Runge-Kutta. You should measure time in units of years, and length in units of AU; so, what should you set GMS equal to? Initialize a particle (Earth) at x=1, y=0, vx=0, vy=2π, and integrate.
  2. Write two functions to transform between the Cartesian variables used in your integrator and the particle's position relative to an ellipse. One of the functions, "ellipse_to_xy", will take as input the four quantities a, e, θ, and θE, and output the four quantities x, vx, y, vy. The second function, "xy_to_ellipse" will do the opposite. To test (and show me) that your code works, choose 4 random numbers for a, e, θ, and θE (.1,.2,.4,.3), apply ellipse_to_xy and print out x,vx,y,vy. Then apply xy_to_ellipse to recover the original values.

    Note: it is straightforward algebra to use formulas i-iii above (together with the definitions of u and h) to derive the transformation laws. A few hints:
  3. Using your functions from question 2, initialize a test particle ("Mercury") with a=0.39AU and e=0.206, θE = -3π/4 and its initial angle θ = θE. Integrate, and plot y vs. x and r vs. θ , as output from your simulation. Also superimpose on these plots the analytic formula for an ellipse (formula i in Prologue above). Make sure you (and I) can see that the theory matches the simulation.
  4. Calculate the effect of Jupiter on the precession of Mercury's perihelion. Do not bother integrating Jupiter's equation of motion. Just force Jupiter to have a circular orbit, with radius equal to its semimajor axis. Start Mercury as in question 3. Use the function "xy_to_ellipse" to output Mercury's θE as a function of time, and hand in the plot. From that, what is the rate at which Jupiter causes Mercury's perihelion to precess? Quote your answer both in radians per year, and in arcseconds per century, and estimate the error in your precession rate.
  5. [BONUS QUESTION] Repeat question 4, but now include the planets Venus, Earth, Mars, Jupiter, and Saturn (Uranus and Neptune are unimportant.). Treat all of those planets as you did Jupiter. What is your result for the precession rate, and with what error? How does this compare with the pre-general-relativity result of 531 arcseconds per century? (When I did this question, I got a slightly different answer. The observed result is 574 arcseconds per century. )
  6. [BONUS QUESTION]
    1. Reproduce Figure 4.15 (both panels). You can force Jupiter to have a circular orbit.
    2. The energy of the test particle is conserved in the rotating frame of Jupiter. The energy in the rotating frame (per unit mass) is:

      where ΩJ is Jupiter's angular speed, and rpJ is the distance of the test particle (or asteroid) from Jupiter. You should first check for yourself that urot is conserved. Now, choose urot equal to its value for the orbit in the left-hand panel of Figure 4.15. Select a range of orbits with the same value of urot. And plot a Poincaré section of these orbits. For this Poincaré section, plot the asteroid's radial velocity versus its radial position every time the asteroid has the same angular position as Jupiter.