...
running...
How to use
Pick a preset, then adjust thrust-to-weight, specific impulse, propellant fraction and the pitch-over kick. Use the time-warp slider to speed up the flight; press Launch again to restart after changing settings. The left panel is downrange distance against altitude, the right panel shows the Earth to scale with the predicted orbit (green if the perigee clears the atmosphere, red if not). Too small a kick leaves the rocket climbing vertically and it falls back; a large kick gives a stretched, eccentric orbit. The ascent is very sensitive to the kick, as in real launches.
The science
Model. The rocket is a point mass in the plane of a spherical, non-rotating Earth with centre at the origin. Gravity is the inverse square law, thrust acts along a programmed direction, and drag opposes the velocity:
dv/dt = -(mu/r3) r + (F/m) t^ - (rho(h) Cd A v / 2m) v, dm/dt = -F/(Isp g0)
Rocket equation. With no gravity or drag the speed gained is dv = Isp g0 ln(m0/mf) (Tsiolkovsky). Orbit needs about 7.8 km/s plus roughly 1.5 to 2 km/s lost to gravity and drag, which is why real rockets are staged.
Gravity turn. The rocket climbs vertically, makes a small pitch-over kick, then thrusts along its own velocity so the angle of attack stays near zero and gravity bends the path over for free. The atmosphere is rho = 1.225 exp(-h/8.5 km).
Orbit elements. From position and velocity the specific energy eps = v2/2 - mu/r gives the semi-major axis a = -mu/(2 eps); the eccentricity vector gives perigee a(1-e) and apogee a(1+e). A perigee above about 120 km above ground counts as a stable orbit here.
Simplifications. A single idealised stage with a constant thrust, a fixed drag coefficient 0.3, no Earth rotation, no wind, no staging, instantaneous throttle and a constant specific impulse. Real vehicles have much lower propellant fractions per stage. Integration is RK4 at 0.02 s.