Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function integrate _ earth ( tmax, d t = 1 e - 3 that returns the trajectory of the Earth, assuming that the

Write a function integrate_earth ( tmax,dt=1e-3 that returns the trajectory of the Earth, assuming that the Earth only feels the attraction from the Sun.
Produce a trajectory for time 0t tmax in steps of dt.
dt is an optional argument with default value 110-3yr.
Return a (N,3) numpy array for the x,y,z coordinates of the earth.
(Note: numpy arrays are containers, so if you are changing a numpy array r in place with r+=v**dt in your code then you need to copy them when appending to your results list, e.g.,
r_values.append(r.copy())
Otherwise you'll find that your list contains N times the same three numbers. If you don't use inplace operations then that's not a problem for you, but the copy is still safe.)
TEST: 1-year Trajectory
Compute and visualize the trajectory for 1yr :
Run integrate_earth(1).
Plot the x and y coordinates.
Label the axes "x(AU)" and "y (AU)".
Write the figure to the file "orbit_earth_only.png".
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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions