The aim of this project is to develop a code for simulating the solar system using a widely popular algorithm for solving coupled ordinary differential equations, the so-called velocity Verlet algorithm. An important aspect of this project is to be able to object orient your code. There are several coupled ordinary differenatial equations where the basic equations, except for various physical constants and variables, are rather similar. Thus, write once and run many times, one of the central points of object orientation, is something which makes our program easier to extend and build upon when we add more planets or moons or other astronomical objects. The basic equations which govern the system are rather simple, a set of coupled equations that codify Newtons law of motion due the gravitational force.
In the first part however, we will limit ourselves (in order to test the algorithm) to a hypothetical solar system with the Earth only orbiting around the sun. The only force in the problem is gravity. Newtons law of gravitation is given by a force
where
We assume that the orbit of the Earth around the Sun is co-planar, and we take this to be the
and
Planet | Mass in kg | Distance to sun in AU |
Earth | 5.20 AU | |
Mars | 0.72 AU | |
Saturn | 0.39 AU | |
Uranus | 30.06 AU | |
Pluto | where Discretize the above differential equations and set up an algorithm for solving these equations using Eulers forward algorithm and the so-called velocity Verlet method discussed in the lecture notes and lecture slides. You can choose if you wish to study the systems in this project in two or three dimensions. Project 3b): Writing an object oriented code for the Earth-Sun systemWrite then a program which solves the above differential equations for the Earth-Sun system using Eulers method and the velocity Verlet method. Write these codes without object orientation first in order to make sure everything is running correctly. Thereafter you should start planning to object orient your code. Try to figure out which parts and operations could be written as classes and generalized. Your task here is to think of the program flow and figure out which parts can be abstracted and reused for many types of operations. For those of you who will focus on the Molecular Dynamics version of Project 5, much of the structures developed here as well as the implementation of the Verlet algorithm, can be used in that project as well. Project 3c): Tests of the algorithmsFind out which initial value for the velocity that gives a circular orbit and test the stability of your algorithm as function of different time steps Check also for the case of a circular orbit that both the kinetic and the potential energies are conserved. Explain why these quantities should be conserved for circular motion. Discuss eventual differences between the Verlet algorithm and the Euler algorithm. Consider also the number of FLOPs involved and perform a timing of the two algorithms for equal final times. We will use the velocity Verlet algorithm in the remaining part of the project. Project 3d): Conservation of angular momentumUse Keplers second law to show that angular momentum is conserved. Discuss your results with circular and elliptical orbits for the Earth-Sun system. Project 3e): Testing forms of the forceTill now we have assumed that we have an inverse-square force with Consider also an elliptical orbit with an initial position 1 AU from the Sun and an initial velocity of 5 AU/yr. Show that the total energy is a constant (the kinetic and potential energies will vary). Show also that the angular momentum is a constant. If you change the parameter Project 3f): Escape velocityConsider then a planet which begins at a distance of 1 AU from the sun. Find out by trial and error what the initial velocity must be in order for the planet to escape from the sun. Can you find an exact answer? How does that match your numerical results? Project 3g): The three-body problemWe will now study the three-body problem, still with the Sun kept fixed as the center of mass of the system but including Jupiter (the most massive planet in the solar system, having a mass that is approximately 1000 times smaller than that of the Sun) together with the Earth. This leads to a three-body problem. Without Jupiter, the Earths motion is stable and unchanging with time. The aim here is to find out how much Jupiter alters the Earths motion. The program you have developed can easily be modified by simply adding the magnitude of the force betweem the Earth and Jupiter. This force is given again by Repeat the calculations by increasing the mass of Jupiter by a factor of 10 and 1000 and plot the position of the Earth. Study again the stability of the Verlet solver. Project 3h): Final model for all planets of the solar systemFinally, using our Verlet solver, we carry out a real three-body calculation where all three systems, the Earth, Jupiter and the Sun are in motion. To do this, choose the center-of-mass position of the three-body system as the origin rather than the position of the sun. Give the Sun an initial velocity which makes the total momentum of the system exactly zero (the center-of-mass will remain fixed). Compare these results with those from the previous exercise and comment your results. Extend your program to include all planets in the solar system (if you have time, you can also include the various moons, but it is not required) and discuss your results. Use the above NASA link to set up the initial positions and velocities for all planets. Project 3i): The perihelion precession of MercuryAn important test of the general theory of relativity was to compare its prediction for the perihelion precession of Mercury to the observed value. The observed value of the perihelion precession, when all classical effects (such as the perturbation of the orbit due to gravitational attraction from the other planets) are subtracted, is Closed elliptical orbits are a special feature of the Newtonian You will now study the orbit of Mercury around the Sun, adding a general relativistic correction to the Newtonian gravitational force, so that the force becomes where Introduction to numerical projectsHere follows a brief recipe and recommendation on how to write a report for each project.
Format for electronic delivery of report and programsThe preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:
Only logged in customers who have purchased this product may leave a review.
Shopping Cart
[Solved] FYS4150 Project 3 $25
|
Reviews
There are no reviews yet.