How to compute the perihelion precession of Earth's orbit?

I want to simulate the perihelion precession of Earth. I tried searching other posts in stack exchange as well relating this question but may be it's my fault that I couldn't understand their answers. I read the history about mathematicians and physicists trying to find a good theory accounting the precession. I read that there are many planetary equation by Newton,Laplace,Hill,Poincare etc. But I am not sure which one gives the more accurate result. I am not even sure if I going on a right track searching the correct theory. I'd really appreciate if anyone could help me with the theory which gives fast and more accurate result?

• This page details the calculation required to model the precession of the orbits of the planets. The section following discusses the relativistic correction for Mercury which is a small correction. – StephenG Apr 25 '18 at 21:42
• This question is rather confused. The link points to the wrong place, the title of the question asks about the Earth's perihelion precession, and the body asks about the contributions of the Sun and Moon the this precession. Those two bodies contribute almost nothing to the Earth's perihelion precession. On the other hand, they are the primary drivers of the Earth's axial precession. Axial precession and perihelion precession are completely different beasts. Until the question is clarified, I am voting to close as "unclear what you are asking". – David Hammen Apr 26 '18 at 1:11
• I don't know about the link, but I do believe that all the sources lead to exactly the same thing; there might be some discussion about correction which is negligible, especially for simulation. So, make sure that you understand these topics: Keplerian motion, conservation, virial theorem, open/close orbit. The most direct way for the simulation is to construct time grids and update parameters in the equations of those metioned topics. The updated parameters include the radial distance, and the total velocity, and the constants include the total angular momentum and total energy. – Kornpob Bhirombhakdi Apr 26 '18 at 10:54
• First of all,I am trying to understand the theory and mathematical part. I have problem with it. – Rima Apr 26 '18 at 10:57

For simulation only, you should be able to show it by simple code as following: $$\vec{a}_t = - \frac{GM}{r_t^2} \hat{r} \\ \vec{v}_{t+1} = \vec{v}_t + \vec{a}_t \Delta t \\ \vec{r}_{t+1} = \vec{r}_t + \vec{v}_t \Delta t$$ where $t$ is time step, $\vec{a}$ is acceleration, $\vec{v}$ is velocity, $\vec{r}$ is position, $\hat{r}$ is a unit vector in radial direction from the origin (set the Sun at the origin), $G$ is gravitational constant, $M$ is Sun mass in this case, and $\Delta t$ is size of time step. You will have to play around with the initial values and step size to get certain orbit representing the case. To make it more real, you derive the initial values from the real parameters, if known.