RK4 spiral trajectory Earth Spacecraft

Ion Engine Orbit-Raising: Direct Two-Body Integration (2D)

This 2D companion to the 3D ion-thruster orbit-raising simulator swaps the analytic circular-orbit shortcut for a direct numerical integration of the underlying physics. Instead of assuming the orbit stays circular and differentiating its energy, this simulator advances the spacecraft's actual Cartesian position and velocity through Newton's law of gravitation plus a continuous tangential thrust force, step by step, using a 4th-order Runge-Kutta integrator whose sub-step size automatically tracks the shrinking-then-growing orbital period. From that raw trajectory it extracts the same osculating orbital elements — semi-major axis, eccentricity, period — that a real mission's orbit-determination software would compute, and checks them live against the 3D view's analytic da/dt growth formula. Watching the two methods agree (or drift apart, if thrust is cranked high enough to break the near-circular assumption) is the actual point: it turns a physics assumption most orbit-raising visualizations quietly bake in in into a number on screen.