Answered step by step
Verified Expert Solution
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 : Python Programming
Assignment : PlanetAnalysis
In this assignment, you will do a simplified modeling of solar system in Python.
First, create a net class that should take a radius and a year length. For example, running mercury anet means that the radius of this planet object is million miles and its year length is 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:
tablePlanetRadiu CMYear Length DaysMercuryVenusEarthMarsJupiterSaturnUranusNeptune
The planet class should have a method, position day that returns the position of the planets on a specific day. For example:
mercury.position
Meaningthat on day Mercury's position is at its starting
position: relative to the Sun at Likewise, we will have compare locations in the figure:
mercury position
mercury.position
mercury osition
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 and 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:
distance mars,
In the second part, create a simulation that runs for days and compute the distance bet ween Earth to Mercury, Venus and Mars each day in two cases: distances are stored exactly, 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 zeromean normal distribution with a STD s Compute daywise distances and store them as timeseries. Then, separately for the noiseless and noisy cases, plot timeseries 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 timeseries transparent Which planet is closest to Earth based on the average distances? Repeat the noisy case with different values of in range and check whether the results change.
Repeat the noiseless simulation for years and compute the average daily distances for all pairs of planets. Create 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
How do your position and distance functions work? What trigonometry functions did you need touse?
Briefly explain how you generated the day timeseries and their averages. Is there any periodic pattern visible? In the noisy cases, does the average ranking change when increases? Try to provide a reasoning for this observation.
How did you form the m atrix and fill it out with the averages of 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 DL 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started