I am trying to model a two dimensional orbit for a two body Kepler problem but have gotten stuck when introducing the time variable.
For a satellite with known semi major axis (a), eccentricity (e), and true anomaly (theta), I have:
r = a*(1-e**2)/(1+e*cos(theta))
How can I calculate theta as a function of time using the Wiki suggested Universal variable formulation method? I have no idea how to implement (am using Python but any algorithm advice much appreciated!)
Alternatively, how do I calculate r as a function of time?
Note: All other orbital elements and masses are available. Also I am trying to come up with a general solution for elliptical, hyperbolic and parabolic orbits.