Question: Using MATLAB. In this question we will use three dimensional plots to model the planetary orbits around the sun. We will focus on the first
Using MATLAB. In this question we will use three dimensional plots to model the planetary orbits around the sun. We will focus on the first four planets of the solar system (Mercury, Venus and Earth). And we will use real time data to gather create the best model. Be advised that the planetary orbits of the planets are elliptical, not circular. We will use Keplers Law of Planetary Motion derived from Newtonian Mechanics. Do not convert the kilometers into meters. Suppress all your answers for this problem.
(a) Create a plot with a sphere at the center of the graph (origin) representing the sun with a radius of 6955000 km. Make sure that the outside of the sphere is painted in autumn colors. (Hint: look up the sphere() function, the colormap() function, and the surf() function).
(b) Create a variable t ranging from 0 to 2? with increments of 0.01.
(c) The following Table gives you important values needed to compute the orbits.
| Planet | Semi major axis (a) in km | Eccentricity(e) |
| Mercury | 57909335.9 | 0.206 |
| Venus | 108204140 | 0.007 |
| Earth | 149597871 | 0.017 |
The equation for a two dimensional elliptical orbit using Keplers law is given by: x = a cos(t) and y = b sin(t) Where, b = a sqrt( 1 ? e^2) Using the above equations, compute the x-coordinates and y-coordinates for the elliptical orbit of Mercury.
(d) As in part (d), compute the x-coordinates and y-coordinates for the elliptical orbit of Venus and Earth.
(e) Create a vector z of zeros that has the same length as the vector t from part (b). This is the z-coordinates for the Earths, Mercurys, and Venus orbits.
(f) Plot the Mercurys orbit in the same plot as the sun sphere. Remember that the center of the orbit is at the origin, and use a green line for this plot. (Hint: look up plot3()).
(g) Plot Venus orbit in the same plot as the sun sphere. Remember that the center of the orbit is at the origin, and use a red line for this plot. (Hint: look up plot3()).
(h) Plot Earth orbit in the same plot as the sun sphere. Remember that the center of the orbit is at the origin, and use a blue line for this plot. (Hint: look up plot3()).
(i) Add label to the axis and include units km. Title the graph Keplers Law of Planetary Motion. Adjust the axis to be all equal. (Hint: look up axis).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
