In this assignment we will model the orbits of two planets (or a planet and a
“moon”) about a primary (the Sun). To simplify things we restrict ourselves
the motion to the
The equations of motion that arise from Newton’s second law (see below) can be written as eight coupled first-order ordinary differential equations; these equations we will integrate via 4th-order Runge Kutta.
For Part I, consider just one planet in orbit around a primary. We restrict
the planet to the
After the equations of motions are solved, the program will write into a file
time
The program should now work for two planets orbiting a primary star fixed at the origin. In this case you will have 8 dependent variables.
The output now includes columns for
It would be quite beneficial to you if you had a Linux system because it would enable you to use the makefile included.
If this is the case then what you do is open a terminal, use the cd command to change to this directory.
Then type make.
You'll see some gfortran commands being executed. All of this has created an exectuable file called nuclear-reactor.
In order to run this executable you type ./planetary. This will make the program compile with default values which produce a circular orbit with one planet around a primary. However if you want to run a different input then you do ./planetary namelist file name Below are the available namelist files:
circular_motion.namelist - 2 planets orbitting a primary in a circle. circular_motion_part_1.namelist - 1 planet orbitting a primary in a circle. elliptical_motion_part_1.namelist - 1 planet orbitting a primary in an ellipse. moon_motion.namelist - 1 planet orbitting another planet that orbits a primary.
So, as an example, if you want the first one then you do ./planetary circular_motion.namelist
You can edit the namelist input yourself to see how the output changes, slight deviations in initial conditions can wildly change a planet's orbit!
Next you can type jupyter notebook into the terminal to see the graphs of 2 planets orbitting a primary and the moon scenario.




