# Plotting the orbit of the Earth around the Sun. Error: step size is effectively zero; singularity or stiff system suspected

I've been asked to plot the orbit of the Earth around the sun over a period of three years. I've copied my exact code below. When I try to run it I get a series of errors, the first being:

NDSolve::ndsz: At t == 9.641612453331499*^-11, step size is effectively zero; singularity or stiff system suspected.

I'm fairly new to Mathematica and I'm not sure why this error is appearing, or, when an error does appear, how to correct my code given what the error tells me.

G = 6.6723*10^(-11);
mSun = 1.989*10^30;
solEarth1 = NDSolve[{r''[t] == -G*mSun*r[t]/Norm[r[t]]^3, r == {1, 0}, r' == {0, 29785.1}}, r, {t, 0, 94608000}][];
ParametricPlot[r[t] /. solEarth1, {t, 0, 94608000}, AxesLabel -> {"x (m)", "y (m)"}, PlotLabel -> "Orbit of Earth around the Sun"]

• You have constants that differ by dozens of orders of magnitude; numerical results will be catastrophically bad. Please, work in natural units, where all parameters are of order one. – AccidentalFourierTransform Oct 2 '18 at 14:43

Error in the initial data. Earth's distance from the Sun 1 astronomical unit. But in meters it will be 149597870700.After fixing the code works

G = 6.6723*10^(-11);
mSun = 1.989*10^30;
solEarth1 =
NDSolve[{r''[t] == -G*mSun*r[t]/Norm[r[t]]^3,
r == {149597870700, 0}, r' == {0, 29785.1}},
r, {t, 0, 94608000}][]
ParametricPlot[r[t] /. solEarth1, {t, 0, 94608000},
AxesLabel -> {"x (m)", "y (m)"},
PlotLabel -> "Orbit of Earth around the Sun"]
` 