Question: The purpose of programming assignment 1 is: a) Practicing computational/algorithmic thinking to solve an Astronomy problem b) Using variables and simple arithmetic expressions to develop




The purpose of programming assignment 1 is: a) Practicing computational/algorithmic thinking to solve an Astronomy problem b) Using variables and simple arithmetic expressions to develop a Python solution Saturn's Orbit jupiter Orbit Halley's Comet's orbit Period 76 yn) 1990 and 1986 1948 Sun Uranus orbit Neptune's orbit c Figure: The planets and Halley's comet revolves around the sun 1. Problem Description: Kepler's laws of planetary motion published in 1609, are three scientific laws describing the motion of planets around the Sun. Actually the usefulness of Kepler's laws extends to the motions of all natural and artificial satellites, as well as to stellar systems and exo- planets. The third law summarizes the relation between the period of an orbiting body and its average distance to the body it orbits. The ratio of the square of an object's orbital period T with the cube of the average distance R is the same for all orbiting objects." Case 1: Kepler's Third Law relates the period T of a planet, which is the time spent for one revolution around the Sun, to the average distance R to the sun. The units for both quantities are taken from the earth's orbit: period is measured in years, which is the 11 https://earthsky.org/space/comet-halley-parent-of-2-meteor-showers https://www.futurelearn.com/info/courses/maths-linear-quadratic/0/steps/12172 time taken for the earth to complete one of its orbits, and distance is taken in astronomical units (au), which is the average distance from the earth to the sun. So for the earth T=1 and R=1 by definition. 72 = 1 R3 For the planet Mars, T=1.88, and R=1.52 (See table 1) 12 1.882 R3 1.523 1.01 Here is a table of periods and average distances for some planets, and other famous celestial bodies in the solar system such as Halley's comet: Planet 4 Period (yr) 0.241 0.615 1.00 1.88 11.8 29.5 84.0 165 248 75.3 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto Halley's comet Average Distance (au) 0.39 0.72 1.00 1.52 5.20 9.54 19.18 30.06 39.44 17.55 5 6 7 8 9 10 Table1: Period of planets and comet and their average distance to the Sun Case 2: Kepler's Third Law also should hold for satellites of the earth such as the moon and her geostationary telecommunication satellites. The moon is orbiting around the earth at about 384,400 km from the earth. The period of the moon is about 27.32 days. The geostationary satellites are exactly at the correct height to ensure that their orbit times are exactly one day. This guarantees that they are constantly above a fixed equatorial location on the earth, as it also rotates around its axis once a day, so that their periods in years are measured from the center of the earth the height such a satellite is 42,164 kilometers (See table 2). Period (day) 27.32 1 Average Distance (km) 384,400 42,164 1 2 Moon Geostationary satellites Table2: Period of the satellites and their average distance to Earth It is worth noticing that the distance from Earth to the sun is one au. equivalent to about 150 million km, and time taken for Earth to complete one of its orbits is 1 year, which is equivalent to 365 days. We want to investigate whether the law of harmonies holds for a selection of planets (Mercury, Venus, Earth, and Mars), and for the Halley's comet that revolves around the Sun (See table 1), as well as for the satellites of the earth such as the moon and the geostationary satellites (See table 2). 2. Input/output: Expected Input and Output. 3 In [93]: runfile(/Users/hamzazidoum/Documents/2101/2101_52821/Programming Assignments/pal_solution.py", wdirs/Users/hamzazidoum/Documents/ 2101/2101_s2021/Programming Assignments'? Welcome to Keppler's Third Law Software @HamzaZidoum Period tyr) Radius (au) T^2/R^3 yr"2/aum3 0.39 Orbiting Object Mercury Venus Earth Mars Halley's Comet 0.24 0.61 1.00 1.88 75.30 0.72 1.00 1.52 0.98 1.01 1.00 1.01 1.05 17.55 Moon Satellite 2.075 0.003 @.002560 0.000281 333441.51 337093.75 Bye! 3. Deliverable Submit a Python source file: pa1_XXXXXX.py. For instance, if your ID is 38000, then you should submit a file pa1_38900.py Your source file will consist of three parts: a) Header: includes documentation with your name, your student id, and section number, the problem statement (a short description of the purpose of your code). data description (input, and output variables used in the program including constants), and the algorithm in pseudocode. b) Python program c) Your conclusion in few sentences as a comment in the file header * The rest of the planets in the solar system can be used as supplemental test cases, * If you fail to name your file correctly you will loose marks, see grading table. Make sure submit the py file. Submit well ahead of the deadline to avoid possible Internet congestion and other connection problems, 3 4. Grading Table Item Marks 76 12 2 Problem Solving: Student Info, Program design, Conclusion (Header) Programming Style: Comments, Naming in accordance to Python convention Variables: including constants Arithmetic Expressions Displaying the results (with correct format) Debugging: Program compiles and runs without errors Proper File naming & submission TOTAL 14 /3 /2 /1 /20 Late Submission Policy: (a) 1-24 hours: 25% of the mark will be deducted. (b) > 24 hours: Not accepted. Code of ethics: It is essential that each student solve all programming assignments, lab tests and exams individually unless instructed otherwise, e... for group projects. Copying, plagiarism, collusion, switching, and falsification are violations of the university academic regulations. Students involved in such acts will be severely penalized. The department has adopted a firm policy on this issue. A zero mark will be assigned the first time a student is caught involved in copying and his/her name will be added to a watch list maintained by the Head of Department. Further repeated involvements in copying will cause the student to get an F grade in that course. This is in line with the university academic regulations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
