Consider bodies interacting through Newtonian gravity. That is, the gravitational potential between two bodies of mass mA and mB that are separated by a distance vector rAB= rA - rB is given by
and the force on body A would be given by
The force on body B would be equal and opposite.
Here, G can be taken to be approximately 6.7 x 10-11 m^3/kg/s^2.
There are three parts to this assignment:
- Write a module that contains functions to compute the interaction of two bodies (potential and force), and to compute the interactions of three or more bodies.
- Use this module together with the ODE solvers from the GNU Scientific Library to write a code that solves the equations of motion:
for the following parameters:
and the following initial conditions:
The code should write out the result either in ASCII or in NetCDF format (your choice). Read the GSL docs and pick an integrator that does not require a "Jacobian". From the results, estimate the period P of the orbit this forms.
- The orbit found in part 2 should be circular, and body A should be effectively stationary. Thus, In a co-rotating coordinate system with A as its center and rotating with a period P, both bodies would seem to be fixed. An additional test particle C, i.e., a particle of very low mass, e.g. mC=6000 kg, would, however, feel an additional centrifugal force
We can say that the particle $C$ feels an effective potential
where you may assume A and B are not moving in the co-rotating frame. Write a program to find, using the root finding machinery of the GSL and the module from part 1, the values of r where the derivative of Veff is zero (these are called the Lagrange points). You need to only consider situations where A, B and C are aligned in the co-rotating frame.
Use git and other best practices throughout this assignment.
Submit all the code for these three parts, as well as the Makefile and the git log by Friday February 18, at midnight.