I just checked in support for xyz+velocity sampled trajectories. This
is based on some code that I wrote for ESA that hadn't made it into
the main Celestia distribution (but which was available in the STA
SourceForge project.)
An xyzv file is basically and xyz file with velocities added on. Like
xyz files, they are ASCII. Each record in an xyzv file contains seven
values:
1: Julian date <double>
2: position x <double>
3: position y <double>
4: position z <double>
5: velocity x <double>
6: velocity y <double>
7: velocity z <double>
Position is in kilometers, velocity in kilometers per second. xyzv
files can be used interchangeably with xyz files in both SampledOrbit
and SampledTrajectory: the choice of which to use is based on the
filename.
I was curious about how much additional accuracy the velocities
provide. I wrote a small script that samples two trajectories over a
30day period at fixed intervals and calculates the RMS of the
differences. The results of using different sample intervals in xyz
and xyzv files were quite interesting. As a sample trajectory, I just
a 30day segment of MESSENGER's trajectory, starting April 2. This is
just a cruise phase of the missionno dramatic course alterations
from close flybys. As a basis for all comparisons, I used an xyz
orbit with samples every 5 minutes. The RMS differences for different
sample intervals in an xyz file were:
dt rms diff
1h 0.003158 km
6h 0.6535 km
12h 5.231 km
1d 41.95 km
2d 338.8 km
For the xyzv file:
dt rms diff
1h 0.0009095
12h 0.019
1d 0.3087
2d 4.931
Interestingly, the error appears to grow proportionally to dt^3 for
positiononly samples and dt^4 for position+velocity samples. Even
given the increased size per sample (56 bytes vs 32 bytes),
position+velocity is a clear winner for accuracy per byte. An xyzv
trajectory sampled at one day intervals is superior to an xyz
trajectory with a sample interval of 6 hours. Since the error grows
faster with xyzv files, there's some point at which they theoretically
become /less/ accurate: a quick calculation gives that interval to be
~135 days, or longer the current heliocentric orbital period of
MESSENGER, suggesting this isn't quite the paradox it at first seems.
Another big advantage of xyzv files is that they don't produce strange
variations in the trajectory when the sample interval is nonuniform.
I've seen this happen with the MESSENGER xyz file and to a lesser
degree with Cassini. I double checked the tangent calculation used in
samporbit.cpp, and it looks fine. My conclusion is that these
anomalies are in inescapable result of estimating the tangent with
finite differences.
Chris
