Okay, I have some answers... But first something I forgot to spell out
explicitly in my previous message: I'm *very* happy to see that the OpenOrb list
has active members that are willing to help out with issues such as the present
one. Thank you all for taking the time from your busy schedules to contribute to
the discussion!
Now, let's proceed to the answers. The short take home message is that there is
*no* error in the ephemeris that you compute.
The longer explanation is that you have to account for the fact that the
ephemeris provides you the situation as apparent from the location and date for
which you compute the ephemeris. Since the speed of light is finite and it takes
about 8 minutes for photons to get from the Sun to the Earth, an ephemeris
computed for the geocenter for a date equal to the time of perihelion will
actually show the coordinates some 8 minutes before the object reaches
perihelion. Although the 8-min difference may sound negligible (I was fooled by
it!), it turns out that the speed of the object at perihelion (q=0.0008...) is
so large, about 0.85 au/d = 1500 km/s based on elementary celestial mechanics,
that it explains the difference. (Note that this is a hypothetical situation
because with q<0.00465 an object would collide with the Sun.)
The silver lining with this thread is that I found another bug in the code and
it is the reason it took me a bit longer to figure out what was happening. I
started hunting for the bug by resorting to the command-line version of OpenOrb,
that is, the one with a Fortran front end. It has a configuration option that
allows you to determine which types of orbital elements are used in the
computations. Playing around with them I found out that by feeding in cometary
elements (as provided by RJ in the message that started this thread) and forcing
the code to calculate with cometary elements I could compute an ephemeris for
which r=q when t=tperi. So I figured that the use of the other element types
must lead to erroneous results, and started to hunt for it there. Only yesterday
did I realize that I had made a mistake in my thinking, and it's instead the use
of cometary elements that produce the wrong but correctly-looking result. I've
yet to locate and fix the bug, but it doesn't affect the Python version because
the incoming orbital elements are internally converted to cartesian elements.
Mikael