Need to produce a code with object oriented programming


Python Programming Assignment -

Need to produce a code with object oriented programming using python, which will produce the simulation of the orbits of the planets around the sun and display the animation in 2D. Along with the code, need to produce a project report as well

Project task -

Your task is to produce a simulation of the orbit of the inner planets (Mercury, Venus, Earth, Mars), however, you should code the simulation in such a way that adding new planets does not involve changing the code. The simulation should read the planet details from a file and show the orbit of the planets as they move around the sun in a graphical display. Your code will implement the Beeman integration scheme to update the position and velocity of the planets at each time step. The program should calculate the orbital periods in Earth years, and these should match the actual ratios -so that a day on Mercury should be 4 times shorter than an Earth day. You should also regularly write out to a file the total energy of the system - the sum of kinetic and gravitational potential energy - to check that it is conserved.

Experiments -

Once you have a working code, you should work through some, or all, of the following experiments. Note that most of the marks for the project will be for:

  • producing a code that works
  • investigating at least two questions
  • producing a project report

Satellite to Mars

Two Earth years after the start of the simulation you wish to launch a satellite from Earth to perform a fly-past of Mars.

Question 1: Find initial velocities that will enable a satellite to get close to Mars. Does your satellite ever get back to Earth?

Once you have found a path that lets the satellite get to Mars you should check to see if your journey time is similar to that of NASA's Viking probe.

Care must be taken to start the satellite from just off Earth (so that there is no division by zero) and also to ensure that the starting velocities are realistic - a probe could get to Mars in a few days if it were fired fast enough but carrying that much fuel is prohibitive!

Question 2: Under what conditions is energy conserved (or not) during your simulation? Illustrate your results graphically.

Guidance on Writing the Project Report -

Structure, style and length - Your report should include the following sections:

1. Introduction. A short summary of your project, the experiments that you tackled and the aims of these.

2. Methods. A description of your program design and the algorithms that you implemented.

3. Results and Discussion. The key results from your experiments and a discussion of what they mean.

4. Conclusions. A short recap of the purpose of the project, whether the objectives of your experiments were met and suggestions for future work.

Your report should be a maximum of 3,000 words.

Attachment:- Assignment Files.rar

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Need to produce a code with object oriented programming
Reference No:- TGS02721606

Expected delivery within 24 Hours