Before reading this long message, please know that this is question is posted to know whether there is a method to find the relation between between the orbital velocity of a planet on an elliptical orbit and time.
I am trying to model the orbital velocity of Mercury orbiting the Sun on an elliptical orbit,that is the path of the orbit cannot be assumed to be circular as one might do at a high school level.
I have visited several sources online, I have tried to derive the equation myself and no matter what I do, I cannot seem to come up with an equation for this. I did come across the formula for orbital velocity in terms of the radius of orbit at any given instant; however, I could not use this to figure out a relationship between velocity and time either. The equation is as follows: $$v=\sqrt {\frac{2GM}{r}-\frac{GM}{a}}$$ Where, $v$ is the orbital velocity, $G$ is Newton's gravitational constant, $M$ is the mass of Sun, $r$ is the orbital radius of a planet around the sun at any given instant (not constant on an elliptical path), and $a$ is the semimajor axis of the elliptical orbit.
On the other hand, when I tried deriving the equation, I got this differential equation:
Now, I tried solving this differential equation and I believe this is not solvable since the integral for the velocity terms is unsolvable (if I am correct). So, for this, I reached out to my Math teacher and asked her if I there was some other method to solve the differential equation and she suggested I use the slope fields method. I tried it out but for some reason, this specific differential equation is not plotting out on any of the technology I used for plotting slope fields. Next I tried to plot these slope fields manually by the use of a graphing calculator and realized that the differential equation that for a particular range of $v$, $\frac{dv}{dt}$ is coming out to be complex.
So from here, I tried to find the range for which the value of $\frac{dv}{dt}$ is real; however, so far I have been unsuccessful. If someone can provide me with a pre-existing equation which describes this relation or knows a method derive the equation, or knows how to solve the differential equation mentioned above, it would be of great help to me.