cleoanka

an interactive page · n-body

Solving the orbit all at once

Instead of stepping forward, guess the whole future and let the guess correct itself. Waveform relaxation, retarded gravity, and why it is solved in pieces.

canvas & code, no dependencies · aura-volterra-engine on GitHub


1

Not step by step, but all at once

The textbook way to compute an orbit is familiar: take a small step from the current position and velocity, recompute the force, take another step. Methods like RK4 do this very well, but they are sequential by nature; step two cannot start before step one ends.

The same equation of motion can be written as an integral: the position at any moment is the starting position, plus the drift of the starting velocity, plus every acceleration felt so far, integrated twice. In this Volterra form something interesting becomes possible: guess the whole trajectory, evaluate the accelerations along the guess, integrate, and get a new, better trajectory. That is Picard iteration, and applied to a whole trajectory at once it is called waveform relaxation.

FIG. 1 — The first guess is a straight line, as if nothing pulled the planet. Each iteration updates the whole curve at once; the green stretch is the part that is already right. The faint dashed line is the full orbit. The chart at the bottom right is the largest change between iterations (log scale).

Press play and watch the green stretch. Correctness advances from t = 0 like a wavefront: every sweep changes the whole curve but only lengthens the correct part a little. For Volterra equations Picard always converges eventually over any finite horizon; that is a lovely guarantee from the theory. But the iteration count grows with the horizon, and around close passes, where the force gets very steep, a long horizon can nearly stall it. Damping (β < 1) adds safety in stiff cases but only slows the easy ones.

2

Piece by piece: windows

Since every sweep walks the whole horizon but only pushes the correct part forward a little, solving a long horizon in one piece is wasteful. Cut it into short windows; converge each one on its own and let its end position and velocity start the next. aura-volterra-engine’s continuous mode does exactly this, sliding windows forever with a fixed-size delay buffer so memory stays constant.

FIG. 2 — Three turns of a close-pass orbit, cut into as many windows as you choose. Below: how many iterations each window needed. The note shows the total work (number of force evaluations) and how far the result is from the step-by-step answer on the same grid.

One window converges too, but it costs about 90 thousand force evaluations. Cut into twelve windows the iteration count rises, yet each iteration sweeps a short piece, so the work drops five-fold; with twenty-four windows it approaches eight-fold. The price is small and shown honestly: each window stops at a tolerance, and that residue grows a little as it is handed across close passes. The result is still the step-by-step answer: relaxation does not find a different one, it reaches the same one by a parallelisable road.

3

Gravity is not instantaneous

Newton’s gravity travels infinitely fast: the moment the star moves, the planet feels it. In reality the influence arrives at the speed of light, so the planet is pulled toward where the star used to be. The Volterra form carries this naturally, because it is already an integral over the whole past.

But retardation applied naively sets a trap. Pulling the planet toward the star’s old position adds a small torque, and the orbit slowly grows. Laplace noticed this in 1805 and concluded that gravity must be millions of times faster than light. In general relativity the effect almost entirely cancels: the field also carries the source’s velocity, so the force points very close to where the star is now. The engine’s aberration correction models this.

FIG. 3 — The star traces a small circle around an unseen companion. The rings are influence spreading from it at speed c. The hollow circle is where the planet “sees” the star right now; the thin line is the direction of the force. The curve below is the drift in the planet’s orbital energy.

With naive retardation the energy drift piles up in one direction; with aberration correction on it stays far smaller at the same c and looks like Newton’s wobble. This figure is a toy: the real engine uses the full 1PN (Einstein–Infeld–Hoffmann) equations. But the shape of the trap, and of the way out, is the same.

picard
Fixed-point iteration that guesses a whole trajectory and keeps correcting it.
windows
Cutting a long horizon into short pieces that converge; in continuous mode they slide with constant memory.
retardation
Gravity that travels at finite speed; the naive version inflates orbits, aberration correction balances it.