Create a working simulation of the solar system including:

Mars, Mercury, Earth, Venus, Jupiter, Saturn, Neptune, Uranus, and the asteroid Apophis.

Use JPL Horizons data (as demonstrated in class) to initialize the locations and velocities for each planet/asteroid. Including the gravitational forces of the sun and the gravitational forces of each of the objects on each other. Start your simulation with data from Dec 1st 2019, at 00:00 UTC time.

Use the Dormand-Prince algorithm for time-stepping (but not ode45) and pick an appropriate tolerance to achieve accurate results.

Initially, I have two programs. One is StateInitialization.m, the other one is PlanetOrbit.m

I’ve got all the initial positions and initial velocities of all the targets, all of these codes are in StateInitialization.m

gravity.m is a function that is used to calculate the acceleration of planets.

Physics.m is the name of the program I want, and I’ve tried to write some, but I’m still not good at it

Turn in the following:

(1) A picture showing the orbits for the first full rotation around the sun of all the inner planets. (That is plot the positions over a length of time where all planets/asteriod have at least completed a full orbit starting on Dec 1st 2019). (Hint: Use the command axis image.)

(2) A picture showing the orbits for the first full rotation around the sun of all the outer planets. (That is plot the positions over a length of time where all planets/asteriod have at least completed a full orbit starting on Dec 1st 2019). (Hint: Use the command axis image.)

Is this the question you were looking for? Place your Order Here