Central-force orbits
Compare planar orbits in three central-force laws and inspect numerical conservation errors.
About this tool
A particle of unit mass moves in a plane under the attractive radial force F = −k/rⁿ, for n = 1, 2 or 3. All model quantities are dimensionless. It starts at (x,y) = (r₀,0) with (vₓ,vᵧ) = (0,vₜ). Inputs are k = 0.2–3, r₀ = 0.3–2.5 and vₜ = 0–6. The Circular speed button sets vₜ = √(k/r₀ⁿ⁻¹) with the available floating-point precision. It changes the input without starting a calculation.
The potential is U(r) = k ln(r/1) for n = 1, −k/r for n = 2 and −k/(2r²) for n = 3. The reference radius of the logarithmic potential is 1. Energy E = (vₓ²+vᵧ²)/2 + U(r) and angular momentum L = xvᵧ−yvₓ are calculated from each stored state. The effective potential Ueff(r) = U(r) + L₀²/(2r²) uses the initial angular momentum; its dashed reference line is the initial energy E₀.
Only the inverse-square law n = 2 displays the Kepler eccentricity e = |r₀vₜ²/k−1|. For E₀ < 0 and L₀ > 0 it also displays the analytic period 2π√(a³/k), with a = −k/(2E₀). A radial start has no displayed orbital period. No conic eccentricity or general period is inferred for n = 1 or 3. The presets demonstrate a circular and an elliptical inverse-square orbit, an n = 1 rosette, an n = 2 escape orbit, and an n = 3 inward plunge. Selecting a preset only prepares inputs.
The integration horizon T is 0.5–50 and the maximum step h is 0.0005–0.02. Cartesian fourth-order Runge–Kutta uses a step no larger than min(h, 0.005r/|v|, 0.005√(rⁿ⁺¹/k), T−t); the speed-based bound is omitted at zero speed. This geometric restriction is not an error guarantee. All accepted states remain stored. A smaller h may improve accuracy where it further reduces the actual step; long runs and many revolutions can still accumulate error.
Calculation ends at T, the inner numerical radius 0.05r₀, the outer radius 20r₀, or 250000 accepted steps. Radius crossings are located within a step; an interior radial turning point is also checked so a brief excursion is not skipped. The singular centre is never traversed. A nonfinite numerical state stops the calculation with an error. A radius cutoff is a computational boundary, not a physical collision model or a general escape criterion: under n = 1 an outward-moving particle can return. The actual end reason and time remain visible.
The reported energy and angular-momentum changes are signed values E−E₀ and L−L₀ at the cursor, together with their largest absolute changes over the stored trajectory. They are not relative errors, so zero initial energy or angular momentum is valid. Initial and current values are kept separate.
Simulate calculates in cancellable portions. Playback then traverses the computed interval in eight display seconds, at most 0.25 display seconds per frame. It selects the last stored state at or before the requested time; it does not integrate again or invent intermediate positions. The entire path remains visible on equal x/y scales. Only the drawn polyline may be simplified within 0.25 screen pixels; all numerical states and drift values are retained. Play at the end restarts from the beginning, while End selects the final state. Pausing, hiding or leaving discards elapsed playback time; pending calculations are cancelled when hidden or left. Edits and Reset clear results, with Reset retaining inputs. Navigation within the app preserves completed results and cursor, paused; a full reload restores valid inputs only.
Sources: MIT, Peraire and Widnall, Lecture 16; Fitzpatrick, General central-force motion; and Exercises on central orbits. Parameter ranges, numerical cutoffs and playback timing are choices of this tool.