OK, a quick summary and update:
So far, I've gone through an exercise of building an off-line numerical integrator with which to test the accuracy of Orbiter's integration engine. To make a like-for-like comparison, I have:
a. adjusted Orbiter's configuration files so that the Solar System has only two gravitating bodies (the Sun and Mars);
b. built interpolation functions based on Orbiter output so that my integrator has, to within a few metres, the Sun and Mars following the same trajectories as used by Orbiter;
c. checked to make sure that I was using the same masses (and other parameters) as Orbiter.
In principle, then, both Orbiter's integration engine and mine should integrate a trajectory in much the same way. To test this, I worked out the initial conditions needed to send a ship on a near parabolic orbit around the Sun on a 111 day and 4 AU journey from a point on one side of the Solar System near Earth's orbit to the other side and a (high-speed) rendezvous with the centre of Phobos. I worked out that my firing solution should be accurate to within a metre or so, and yet, when the same initial conditions were run through Orbiter's integration engine, the ship arrived at Phobos around 1.7 seconds too late (and, consequently, about 8.1 km 'off target'). This discrepancy, though small, had me stumped. Basically, there didn't seem to be any control parameters left to explain the difference.
[Just to put this in perspective, and to highlight how pedantic this is, one can liken the exercise to lobbing a stone across a garden and fretting anxiously that the stone hit the ground 'off-target' by the width of a few atoms. Not the sort of stuff likely to cause empires to crumble.]
Bu, anyway, a number of helpful comments were forthcoming but one in particular from 'martins' (a.k.a., presumably, Martin Schweiger, author of Orbiter) relating to the fact that Orbiter was a bit picky about which contributions to the gravitational fields applied to trajectory determination at any point in time. As it turned out, I quickly worked out that the contribution to the gravitational field from Mars 'switched' on at some point between MJD 51949.7 and MJD 51949.8 - roughly 32.5 days before arrival at Phobos - i.e. when one is still a very, very long way from Mars.
Now, this 'switching on' of the gravitation field isn't, strictly speaking, the way that Newtonian gravity works. Normally one would sum the components of the gravitational field from all of the gravitating bodies (in this case, the Sun and Mars) no matter how far away one is. Notionally, then, we are all affected by the slight gravitational tug of Jupiter and Saturn, say. So, why throw away the contribution from Mars if one is a far away from it? Well, basically for the same reason that we don't include the gravitation contributions from Alpha Centauri in our calculations: the magnitude of those contributions is generally deemed to be too small to matter. But calculating those contributions is computationally costly so that to ensure that Orbiter doesn't spend an inordinate amount of time calculating gravitational contributions of little consequence, the very long tails of the gravitational potentials is simply cut off. This simplifies things enormously and allows Orbiter to devote more resources to displaying breathtaking imagery without much by way of a significant deviation from real physics.
And generally this is all very reasonable - except, that is, when one is attempting to test the accuracy of Orbiter's integration engine using precision integrators. In this case, and rather an exceptional case at that, Orbiter's treatment of long-range gravitational forces do matter and one needs to take account of the gravitational cut-off if one is to explain the 1.7 second delay.
So, then, what is the explanation for the delay. Well, when calculating the initial conditions for my trajectory using my integrator, I assumed that the tail of Mars' gravitation field was there. To counter this additional tug from Mars, the initial conditions included a very, very small amount of additional 'outward' velocity. However, when run through Orbiter, this pull from Mars wasn't there so that the additional 'outward' velocity sent the ship on a slightly longer (and slower) trajectory to Mars - hence the 1.7 second delay in the Phobos 'rendezvous'.
An interesting theory, but how do things work out in practice. Well, in my integrator I can add rule that says that if the date is before MJD 51949.75 the trajectory should be calculated as if Mars was not there; and after that date, the trajectory should include Martian gravitational field. This should bring my model of the gravitational field encountered by the ship (a.k.a. 'test particle') into much closer alignment with that used by Orbiter.
And now, we should be comparing apples with apples.
Using my integrator, I calculate a revised set of initial conditions based upon this modified gravitational potential and then run these initial conditions through Orbiter and, sure enough, the ship arrives at the centre of Phobos to within about 0.01 seconds of the scheduled arrival date; and now just 300m from the notional centre of Phobos. In one fell swoop, all but 4% of the anomaly has been explained. Mystery solved.
What of the residual 300m. Let's put this in context. We are now talking about an anomaly that is approximately 5 x 10^-10 of the total arc length of the trajectory. It isn't much - and probably too small now to worry much about (even for me). But I can hazard a guess as to where the bulk of the residual difference lies: i am using a very slightly different interpolated trajectory for Mars. The difference is just a few metres here and there - but over time, these differences add up. There may also be some issues relating to my rather cavalier treatment of fixed time-steps, but I would put my money on the interpolation issue being the principal cause.
Anyway, having lobbed my stone across the garden and having had it safely land on target (to within the width of an atomic nuclei at any road), I'm happy.
So far, I've gone through an exercise of building an off-line numerical integrator with which to test the accuracy of Orbiter's integration engine. To make a like-for-like comparison, I have:
a. adjusted Orbiter's configuration files so that the Solar System has only two gravitating bodies (the Sun and Mars);
b. built interpolation functions based on Orbiter output so that my integrator has, to within a few metres, the Sun and Mars following the same trajectories as used by Orbiter;
c. checked to make sure that I was using the same masses (and other parameters) as Orbiter.
In principle, then, both Orbiter's integration engine and mine should integrate a trajectory in much the same way. To test this, I worked out the initial conditions needed to send a ship on a near parabolic orbit around the Sun on a 111 day and 4 AU journey from a point on one side of the Solar System near Earth's orbit to the other side and a (high-speed) rendezvous with the centre of Phobos. I worked out that my firing solution should be accurate to within a metre or so, and yet, when the same initial conditions were run through Orbiter's integration engine, the ship arrived at Phobos around 1.7 seconds too late (and, consequently, about 8.1 km 'off target'). This discrepancy, though small, had me stumped. Basically, there didn't seem to be any control parameters left to explain the difference.
[Just to put this in perspective, and to highlight how pedantic this is, one can liken the exercise to lobbing a stone across a garden and fretting anxiously that the stone hit the ground 'off-target' by the width of a few atoms. Not the sort of stuff likely to cause empires to crumble.]
Bu, anyway, a number of helpful comments were forthcoming but one in particular from 'martins' (a.k.a., presumably, Martin Schweiger, author of Orbiter) relating to the fact that Orbiter was a bit picky about which contributions to the gravitational fields applied to trajectory determination at any point in time. As it turned out, I quickly worked out that the contribution to the gravitational field from Mars 'switched' on at some point between MJD 51949.7 and MJD 51949.8 - roughly 32.5 days before arrival at Phobos - i.e. when one is still a very, very long way from Mars.
Now, this 'switching on' of the gravitation field isn't, strictly speaking, the way that Newtonian gravity works. Normally one would sum the components of the gravitational field from all of the gravitating bodies (in this case, the Sun and Mars) no matter how far away one is. Notionally, then, we are all affected by the slight gravitational tug of Jupiter and Saturn, say. So, why throw away the contribution from Mars if one is a far away from it? Well, basically for the same reason that we don't include the gravitation contributions from Alpha Centauri in our calculations: the magnitude of those contributions is generally deemed to be too small to matter. But calculating those contributions is computationally costly so that to ensure that Orbiter doesn't spend an inordinate amount of time calculating gravitational contributions of little consequence, the very long tails of the gravitational potentials is simply cut off. This simplifies things enormously and allows Orbiter to devote more resources to displaying breathtaking imagery without much by way of a significant deviation from real physics.
And generally this is all very reasonable - except, that is, when one is attempting to test the accuracy of Orbiter's integration engine using precision integrators. In this case, and rather an exceptional case at that, Orbiter's treatment of long-range gravitational forces do matter and one needs to take account of the gravitational cut-off if one is to explain the 1.7 second delay.
So, then, what is the explanation for the delay. Well, when calculating the initial conditions for my trajectory using my integrator, I assumed that the tail of Mars' gravitation field was there. To counter this additional tug from Mars, the initial conditions included a very, very small amount of additional 'outward' velocity. However, when run through Orbiter, this pull from Mars wasn't there so that the additional 'outward' velocity sent the ship on a slightly longer (and slower) trajectory to Mars - hence the 1.7 second delay in the Phobos 'rendezvous'.
An interesting theory, but how do things work out in practice. Well, in my integrator I can add rule that says that if the date is before MJD 51949.75 the trajectory should be calculated as if Mars was not there; and after that date, the trajectory should include Martian gravitational field. This should bring my model of the gravitational field encountered by the ship (a.k.a. 'test particle') into much closer alignment with that used by Orbiter.
And now, we should be comparing apples with apples.
Using my integrator, I calculate a revised set of initial conditions based upon this modified gravitational potential and then run these initial conditions through Orbiter and, sure enough, the ship arrives at the centre of Phobos to within about 0.01 seconds of the scheduled arrival date; and now just 300m from the notional centre of Phobos. In one fell swoop, all but 4% of the anomaly has been explained. Mystery solved.
What of the residual 300m. Let's put this in context. We are now talking about an anomaly that is approximately 5 x 10^-10 of the total arc length of the trajectory. It isn't much - and probably too small now to worry much about (even for me). But I can hazard a guess as to where the bulk of the residual difference lies: i am using a very slightly different interpolated trajectory for Mars. The difference is just a few metres here and there - but over time, these differences add up. There may also be some issues relating to my rather cavalier treatment of fixed time-steps, but I would put my money on the interpolation issue being the principal cause.
Anyway, having lobbed my stone across the garden and having had it safely land on target (to within the width of an atomic nuclei at any road), I'm happy.
Last edited: