Author Topic: Trajectories to the Moon  (Read 25834 times)

Offline cjameshuff

  • Mars
  • ***
  • Posts: 373
Re: Trajectories to the Moon
« Reply #15 on: February 13, 2013, 05:45:53 PM »
Runge-Kutta is a good general purpose method for numerical integration, but is complex to implement properly in an n-body simulation (it involves more than just updating each individual body with an RK4 step, because intermediate values depend on estimated future locations of other bodies), and has some properties that make it less ideal for orbital simulation. Symplectic integrators conserve energy...for a lower order method, the error of any given step might be much higher, but orbits won't gain or lose energy over time as they will with methods like RK. With long timesteps, simulations using symplectic integrators get "wobbly" rather than exploding.

Sounds like the benefit of Encke's method is basically in removing the integration error on the largest force influencing a given body. Interesting, but sounds complex and prone to implementation mistakes, as well as requiring a fair variety of additional parameters that need to be tuned for good results.

Offline ka9q

  • Neptune
  • ****
  • Posts: 3014
Re: Trajectories to the Moon
« Reply #16 on: February 13, 2013, 11:50:56 PM »
My understanding is that Encke's method is pretty widely used. I'm not sure if it got us to the moon, but it seems likely. It works well when, as is usually the case, the 2-body motion dominates the perturbations.  The fact that the perturbations are small means you're probably pretty far from their sources so they change only slightly during one integration step. So you can take pretty big steps and still get a good answer.

BTW, a common method for determining if the step size has to be changed is to simply change it experimentally and see how much the answer changes. That's actually integrated (!) into some multistep predictor-corrector methods.

The alternative to Encke's method is Cowell's method, which is just a fancy name for direct numerical integration of all the forces. That would make sense for a lunar trajectory in the vicinity of the equi-gravisphere, or whatever they called it. Remember the hapless FIDO who made some ill-worded comment to the press about the spacecraft "jumping" at that point? The press thought he meant it literally, and he never really did extricate himself. IIRC, Mike Collins teased him about it during Apollo 11.



Offline Bob B.

  • Jupiter
  • ***
  • Posts: 819
  • Bob the Excel Guruâ„¢
    • Rocket & Space Technology
Re: Trajectories to the Moon
« Reply #17 on: February 14, 2013, 08:28:58 AM »
I use the Braeunig method.

Offline ka9q

  • Neptune
  • ****
  • Posts: 3014
Re: Trajectories to the Moon
« Reply #18 on: February 14, 2013, 08:55:32 AM »
Heh. Well, it seems to work.

The books warn that you can't necessarily sweep the truncation problem under the rug by just burning CPU on really small step sizes. You can get into trouble with accumulated roundoff error that way.

But the books were written a while ago, and I don't know the usual floating point precision that was used in those days vs today's IEEE 754 double precision and the Intel 80-bit extension.

Offline cjameshuff

  • Mars
  • ***
  • Posts: 373
Re: Trajectories to the Moon
« Reply #19 on: February 14, 2013, 11:28:54 AM »
The books warn that you can't necessarily sweep the truncation problem under the rug by just burning CPU on really small step sizes. You can get into trouble with accumulated roundoff error that way.

Right. I mentioned this earlier in the thread. Early versions of Kerbal Space Program had this problem...math was done in single precision, and beyond a certain distance, the velocity change over a timestep due to gravitational acceleration rounded to zero when added to the much larger spacecraft velocity. I can see Encke's method possibly helping avoid this, the perturbations being integrated with a larger timestep and generally being similar in magnitude to each other (and much smaller than the influence of the main body).


But the books were written a while ago, and I don't know the usual floating point precision that was used in those days vs today's IEEE 754 double precision and the Intel 80-bit extension.

IEEE 754 dates back to 1985. Some major earlier computers (UNIVAC and IBM mainframes) actually had higher precision floating point: http://en.wikipedia.org/wiki/Floating_point#History

However, I'm not aware of how well these performed or how widespread their use was.

Offline ka9q

  • Neptune
  • ****
  • Posts: 3014
Re: Trajectories to the Moon
« Reply #20 on: February 15, 2013, 02:33:17 AM »
I can see Encke's method possibly helping avoid this, the perturbations being integrated with a larger timestep and generally being similar in magnitude to each other (and much smaller than the influence of the main body).
Exactly. Not only is the 2-body motion solvable analytically [well, almost analytically - I know about Kepler's equation] but you avoid adding lots of tiny numbers to a really big number. You accumulate a bunch of tiny numbers, and when it's not so tiny then you add it to the bigger number.