Mechanics without mystification

Orbital Mechanics by Iteration

An orbit can be understood as a repeated local calculation. At each small interval, work out the gravitational pull, alter the velocity a little, move the body a little, and do the same thing again. Nothing in the procedure needs to know what an ellipse is in advance. The ellipse emerges from iteration.

Orbital mechanics is often introduced from the top down: conic sections, differential equations, conserved quantities and a handsome amount of notation. All of that is useful. It is not the only way into the subject.

There is a more mechanical route. Imagine that the universe advances in very small beats. During each beat you inspect where the bodies are, calculate the gravitational pull at that moment, change their velocities accordingly, move them, and repeat. A sufficiently small beat gives a remarkably good approximation to the continuous motion.

An orbit is not a shape the body is instructed to follow. It is the accumulated result of innumerable small changes of velocity.

The entire idea in one loop

Take a small body orbiting a much more massive primary. Store just four numbers for the small body: its horizontal position x, vertical position y, horizontal velocity vx and vertical velocity vy. Those numbers are the state of the system at one instant.

Now choose a small time step, Δt. One iteration consists of the following.

Find the separation.

From x and y, determine the distance r from the primary and the direction pointing back towards it.

Find the gravitational acceleration.

Its magnitude is μ/r², where μ = GM. The direction is inward, towards the primary.

Alter the velocity.

Add the small velocity change produced during this step: acceleration × Δt.

Move the body.

Use the newly updated velocity to advance the position by velocity × Δt.

Repeat.

The new position and velocity become the starting point for the next step.

r = √(x² + y²)
aₓ = −μx / r³     aᵧ = −μy / r³
vₓ(next) = vₓ + aₓΔt     vᵧ(next) = vᵧ + aᵧΔt
x(next) = x + vₓ(next)Δt     y(next) = y + vᵧ(next)Δt

This particular ordering is called symplectic Euler. The adjective need not detain us. The important point is simply that velocity is updated before position. That tiny procedural choice gives much better long-term orbital behaviour than the most obvious version of Euler's method, which tends to manufacture or destroy orbital energy as it goes.

What the force diagram actually says

Forces on an orbiting body The only real force shown on the satellite is gravity directed towards the central mass. Velocity is tangent to the path but is not a force. F = GMm/r² v No outward force is required in this frame.
Velocity is a state of motion, not another force. Gravity changes the velocity vector a little at every step.
Mutual gravitational forces between two bodies Two bodies attract each other along the line joining them. The forces are equal in magnitude and opposite in direction. force on M force on m M m Both bodies move; the heavy one usually moves less.
For a genuine two-body calculation, update both bodies. Their common motion is around the barycentre, not around an absolutely fixed point.

Textbook sketches sometimes add a centrifugal arrow pointing outward. That can be useful in a rotating reference frame. In an inertial frame, however, it is cleaner to draw only the real gravitational force. The body is not being pushed outward. It simply has sideways velocity and therefore does not fall straight down.

Falling and missing

Suppose the satellite begins to the right of the primary and is moving upward. If gravity vanished, the next position would lie further up along a straight line. Gravity does not cancel that motion. It changes it. The next velocity points a little more towards the primary than the previous one did.

One orbital iteration A body at P0 would move to a straight-line predicted point if no force acted. Gravity changes the velocity so that the actual next point is displaced inward. Repetition bends the trajectory. P₀ no-gravity prediction P₁ inward change in velocity primary
One step is only a tiny bend. Thousands of tiny bends make a recognisable orbit.

Repeat the process and the satellite keeps falling towards a surface that keeps curving away beneath it. The phrase "falling around the Earth" is not metaphorical. It is an unusually compact description of what an orbit is.

Why different speeds produce different paths

Iteration makes the familiar orbital cases almost embarrassingly concrete.

Too little sideways speed.

The body bends inward faster than it moves around the primary and eventually intersects it.

The circular speed.

The inward turning per step is just right to keep the distance roughly constant.

A different bound speed.

The distance changes, producing an ellipse. The body moves faster near periapsis and slower near apoapsis because the same repeated gravitational rule acts at different distances.

Escape speed or more.

The path continues to bend, but not enough to bring the body back. The trajectory is open.

Interactive iteration

The simulator below uses dimensionless units with μ = 1. It applies precisely the four update lines shown earlier. Choose a starting speed, alter the time step, and watch what repeated local updates do.

Iterative orbit simulator

step 0 r 1.000 |v| 1.000 specific energy −0.500

Smaller time steps generally track the intended orbit more faithfully. Increase the step and numerical error becomes visible; the computer is then demonstrating the limits of its approximation as much as the mechanics.

The time step is part of the model

Iteration replaces one impossible request - "tell me the exact future continuously" - with a large number of easy requests - "tell me what happens over the next tiny interval". The price is numerical error.

If Δt is too large, gravity may change substantially during a single step while the program pretends it stayed fixed. The calculated path then departs from the intended one. A smaller step samples the changing force more often and usually improves the result, at the cost of more computation.

Not all iterative recipes behave equally well. Forward Euler is simple but poor for long-lived orbits because its errors tend to accumulate as artificial gains or losses of energy. Symplectic Euler, leapfrog and velocity Verlet are still just repeated updates, but they preserve the geometry of orbital motion far better. High-order Runge-Kutta methods are another family of iterative approximations, particularly useful when high local accuracy matters.

Energy and angular momentum as checks

Two quantities make excellent alarms for a numerical orbit. In an ideal isolated two-body system, total energy and angular momentum remain constant. An iterative calculation will usually let them wobble slightly. If they drift steadily, the time step or update scheme is probably inadequate.

For the simple case used in the simulator, the specific orbital energy is

ε = ½|v|² − μ/r

Negative energy corresponds to a bound orbit, zero to the escape boundary, and positive energy to an unbound trajectory. The simulator displays this value so that the geometry on the canvas can be compared with the numerical bookkeeping underneath.

From two bodies to many

Nothing fundamental changes when more bodies are added. For each body, calculate the gravitational contribution from every other body, add those acceleration vectors, update the velocity, then update the position. Once all bodies have been advanced, begin the next iteration.

aᵢ = Σⱼ≠ᵢ Gmⱼ (rⱼ − rᵢ) / |rⱼ − rᵢ|³

The difficulty is not conceptual but computational. Three bodies can already produce exquisitely complicated motion. A galaxy requires a very large number of repeated force evaluations or clever approximations to them. The universe does not become more purposeful because the loop becomes expensive.

What this way of thinking buys you

Iteration is useful because it separates the physical rule from the shape we later recognise. Gravity does not contain an instruction saying "draw an ellipse". It says, in effect, "accelerate towards the other mass according to this distance-dependent rule". The orbit is the historical accumulation of that instruction.

It also makes perturbations easy to understand. Add atmospheric drag and each loop contains a small opposing acceleration. Add another planet and each loop contains another gravitational vector. Fire a thruster and a chosen velocity increment appears at the relevant step. Radiation pressure, oblateness and relativistic corrections can all be introduced as additional contributions to the same repeated update.

Calculus, differential equations, Hamiltonian mechanics, variational methods and conic-section geometry, inter alia, provide elegant and powerful descriptions of the same dynamics. They are indispensable in many advanced treatments. They are not required to grasp the basic mechanism. The iterative picture reaches the physics from the opposite direction: local rule first, global path afterwards.

The orbit is not commanded. It is accumulated.

That is a useful habit of thought well beyond orbital mechanics. Complex global behaviour can emerge from repeated local rules without a global blueprint. In the present case, the heavens need no intention, no preferred curve and no celestial draughtsman. A force, a velocity, a small interval, and repetition are quite sufficient.

Further reading

Isaac Newton, Philosophiæ Naturalis Principia Mathematica, 1687.

David A. Vallado, Fundamentals of Astrodynamics and Applications, 4th ed., 2013.

Ernst Hairer, Christian Lubich and Gerhard Wanner, Geometric Numerical Integration, 2nd ed., 2006.