As the title says, my objective is to create a simulation of the motion of the planets in our Solar System using Mathematica. All the theoretical background regarding the equations of motion of planets is well know so, the difficult part is to create a functional code. Below I present what I have so far
Clear["Global`"];
pSun = {0, 0};
rMercury = a/(1 + e*Cos[θ]) /. {a -> 0.387, e -> 0.2056, i -> 7.005};
rVenus = a/(1 + e*Cos[θ]) /. {a -> 0.723, e -> 0.0068, i -> 3.3947};
rEarth = a/(1 + e*Cos[θ]) /. {a -> 1, e -> 0.0167, i -> 0};
rMars = a/(1 + e*Cos[θ]) /. {a -> 1.524, e -> 0.0934, i -> 1.851};
rJupiter = a/(1 + e*Cos[θ]) /. {a -> 5.203, e -> 0.0484, i -> 1.305};
rSaturn = a/(1 + e*Cos[θ]) /. {a -> 9.537, e -> 0.0542, i -> 2.484};
rUranus = a/(1 + e*Cos[θ]) /. {a -> 19.191, e -> 0.0472, i -> 0.770};
rNeptune = a/(1 + e*Cos[θ]) /. {a -> 30.069, e -> 0.0086, i -> 1.769};
rPluto = a/(1 + e*Cos[θ]) /. {a -> 39.482, e -> 0.2488, i -> 17.142};
p0 = ListPlot[{pSun}, Axes -> False,
PlotStyle -> {RGBColor[1, 0.65, 0], PointSize[0.035]}];
p1 = PolarPlot[rMercury, {θ, 0, 2 π}, PlotStyle -> Gray];
p2 = PolarPlot[rVenus, {θ, 0, 2 π}, PlotStyle -> Orange];
p3 = PolarPlot[rEarth, {θ, 0, 2 π}, PlotStyle -> Blue];
p4 = PolarPlot[rMars, {θ, 0, 2 π}, PlotStyle -> Red];
p5 = PolarPlot[rJupiter, {θ, 0, 2 π}, PlotStyle -> Brown];
p6 = PolarPlot[rSaturn, {θ, 0, 2 π}, PlotStyle -> Magenta];
p7 = PolarPlot[rUranus, {θ, 0, 2 π}, PlotStyle -> Cyan];
p8 = PolarPlot[rNeptune, {θ, 0, 2 π}, PlotStyle -> Darker[Green]];
p9 = PolarPlot[rPluto, {θ, 0, 2 π}, PlotStyle -> Black];
S1 = Show[{p1, p2, p3, p4, p0}, Axes -> False, Frame -> True,
FrameTicks -> None, PlotRange -> All, AspectRatio -> 1,
ImageSize -> 500]
S2 = Show[{p5, p6, p7, p8, p9, p0}, Frame -> True, FrameTicks -> None,
Axes -> False, PlotRange -> All, AspectRatio -> 1,
ImageSize -> 500]
-------------------- INNER SOLAR SYSTEM --------------------
-------------------- OUTER SOLAR SYSTEM --------------------
I have divided the Solar System in two different plots. The first one contains the Earth-type planets (Mercury, Venus, Earth and Mars) and the second one the gas giants. The orbits of the planets are ellipses and are given in polar form using Kepler's theory. Obviously, Sun is stationary at one of the focuses. The motion of all the planets is two-dimensional. However, all orbits are not co-planar. Here comes the first issue:
(1). Somehow, the ellipses must be rotated according to the inclination of each planet. The inclination (i) in degrees is given. So, we should have a 3D box containing all the 2D inclined ellipses. Earth's inclination is zero thus defying the primary plane (ecliptic) from which we measure inclination.
(2). At every orbit, it would be nice if there was a color dot (like the Sun I already have) indicating each planet. Since we speak of a simulation, every dot (planet) should circulate around Sun following the corresponding orbit. Here we have a problem. Every planet has each one rotational velocity according to its mass. However, the polar equation giving the orbit does not include the mass of the planet. Any suggestions here would be greatly appreciated.
There are also few additional minor issues. For the time being, the first two issues are important and should be resolved first.
From my point of view, this task is indeed not only interesting but also very challenging. Everyone should have a nice model of our Solar System!