Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DSC 4 3 0 : Python Programming Assignment 1 0 0 1 : PlanetAnalysis In this assignment, you will do a simplified modeling of solar

DSC 430: Python Programming
Assignment 1001: PlanetAnalysis
In this assignment, you will do a simplified modeling of solar system in Python.
First, create El a net class that should take a radius and a year length. For example, running mercury =Pl anet (3.5,88) means that the radius of this planet object is 3.5(CM=million miles) and its year length is 88 days. For simplicity, we will assume that orbits are perfect circles, are all on the same plane and are whole days. The orbital radius and year length for the planets are given below:
\table[[Planet,Radiu (CM),Year Length (Days)],[Mercury,3.5,88],[Venus,6.7,225],[Earth,9.3,365],[Mars,14.2,687],[Jupiter,48.4,4333],[Saturn,88.9,10759],[Uranus,179,30687],[Neptune,288,60190]]
The planet class should have a method, position (day}, that returns the position of the planets on a specific day. For example:
>> mercury.position(0)
>>3.5,0
Meaningthat on day 0, Mercury's position is at its starting
position: x=3.5CM,y=0 relative to the Sun at (0,0). Likewise, we will have (compare locations in the figure):
>> mercury .position (22)
>>0,3.5
>> mercury.position (33)
>>-2.47,2.47
>> mercury >osition{440}
>>3.5,0
Given a specific day and length of a year for a planet, you can compute angle "a" and then use simple trigonometry equations to calculate x and Y coordinates as shown below.
In the first part of the assignment, create afunction that takes two planet objects and a day. It should return the Euclidean distance bet ween the planets on that day. For instance:
>>d= distance (earth, mars, 732)
In the second part, create a simulation that runs for 1000 days and compute the distance bet ween Earth to Mercury, Venus and Mars each day in two cases: (1) distances are stored exactly, (2) a noisy version of distances are stored. For simplicity, we assume that the noise is identically distributed for all distance measurements disregarding the planets involved according to a zero-mean normal distribution with a STD "s". Compute day-wise distances and store them as timeseries. Then, separately for the noise-less and noisy cases, plot time-series for the three planets and their averages as horizontal lines in a single plot with distinct colors and clear legends. Make sure the averages are visible enough (say, by making the time-series transparent). Which planet is closest to Earth based on the average distances? Repeat the noisy case with different values of "s" in range ,10] and check whether the results change.
Repeat the noise-less simulation for 1000 years and compute the average daily distances for all pairs of planets. Create 88 array showing average distance between all pairs of planets. Verify the array is symmetric and print it in form of a table. Which planet is closest to Earth on average in this simulation?
Record a four minute video in which you run the code. Then, present your code. Specifically, answer the following questions:
What is the distance bet ween Earth and Mars on day 732?
How do your position and distance functions work? What trigonometry functions did you need touse?
Briefly explain how you generated the 1000-day time-series and their averages. Is there any periodic pattern visible? In the noisy cases, does the average ranking change when "s" increases? Try to provide a reasoning for this observation.
How did you form the 88 m atrix and fill it out with the averages of 1000-year simulation? Check whether the closest planet to Earth is a different planet in this simulation.
Submission: Submit a single .py file containing all the code to the D2L. Do not zip or archive the file. Your code must include comments at the top including your name, date, video link, and the honor statement, "I have not given or received any unauthorized assistance on this assignment." Each function must include a docstring and be commented appropriately.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions