Rocket Equation Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

1. Physical phenomenon

Launching a rocket involves more than raw thrust; it is a delicate trade between burning propellant and accelerating the remaining vehicle. Traditional calculators return a single value for the change in velocity derived from the Tsiolkovsky rocket equation. While that number is indispensable for mission planning, it hides the evolving interplay of mass, momentum, and energy as fuel burns. This simulator exposes that hidden dynamic. It integrates the coupled differential equations for mass, velocity, and altitude in real time and animates the rocket’s climb on a canvas. A striped yellow bar represents the chemical energy stored in the propellant, while a blue bar tracks kinetic energy gained. Watching these quantities change demystifies why achieving orbit requires so much fuel and why every kilogram of structural mass matters.

Real rockets ignite engines for a limited burn time while facing gravitational pull and, near Earth’s surface, atmospheric drag. For clarity the simulation models an idealized vertical launch in a vacuum but includes constant gravitational acceleration to show how thrust must overcome weight. Inputs for initial mass, final mass, exhaust velocity, burn duration, time step, and total simulation time grant full control. The model keeps units strictly in the International System: kilograms for mass, meters per second for velocity, and seconds for time. If you enter inconsistent or non‑finite values, the interface responds with an error rather than attempting nonsensical math. Because all computation occurs locally in the browser, no data ever leaves your machine.

2. Variables and assumptions

The rocket starts with mass m0, including structure, payload, and propellant. After the engines shut down, only mf remains. The effective exhaust velocity ve is the speed of propellant relative to the vehicle, assumed constant. Burn time tb sets how long the engines fire, which implies a constant mass-flow rate:

m˙=mfm0tb

During the burn the rocket experiences thrust F=ve(m˙), and gravity acts downward with acceleration g=9.81 m/s². After the propellant is spent, mass and thrust remain constant and the rocket coasts under gravity alone. Atmospheric drag, staging events, and thrust-vector changes are ignored, matching the assumptions of the classical rocket equation while still allowing an engaging visualization.

The time step Δt controls numerical accuracy: a smaller step increases computational load but better resolves the rapid changes near burnout. The interface limits Δt between 0.01 and 10 seconds for stability, and the total simulation time T must exceed the burn time to capture the coast phase. Input validation keeps mass values positive and requires m0 to exceed mf.

3. Governing equations and the rocket formula

With the assumptions above, the system obeys a set of coupled first-order ordinary differential equations. Mass decreases linearly while the engines fire:

dmdt=m˙

Velocity changes according to thrust and gravity during the burn, and to gravity alone after burnout:

dvdt=m˙vemg(burn),dvdt=g(coast)

Altitude follows the kinematic relation dydt=v. Integrating the thrust term over the burn (ignoring gravity) recovers the analytic Tsiolkovsky rocket equation, which the simulation uses to monitor numerical error:

Δv=velnm0mf

Kinetic energy is Ek=12mv2, and the chemical energy available in the propellant is approximated as Ep=12(m0mf)ve2. Displaying both as bars emphasizes how little of the propellant's energy converts to motion.

4. Numerical scheme

The simulator advances the state using a classic fourth-order Runge–Kutta (RK4) method. Let the state vector be x=(m,v,y). During the burn the derivative function is f(x)=(m˙,m˙vemg,v), and after burnout it is f(x)=(0,g,v). Each step evaluates the derivatives at four points and forms the weighted average:

xn+1=xn+Δt6(k1+2k2+2k3+k4)

where k1=f(xn), k2=f(xn+Δt2k1), and so on. RK4 stays stable for the relatively smooth dynamics of a rocket burn provided the step satisfies Δt < tb/20, a guideline enforced by clamping the user-selected step. After generating the time series, the code compares the final burnout velocity against the analytic value velnm0mf and reports the fractional error as "Δv drift," giving users a sense of numerical accuracy.

5. Worked example

Take the default vehicle: it starts at m0=500000 kg and ends at mf=150000 kg, burning for tb=100 s with an exhaust velocity of ve=4500 m/s. The mass-flow rate is therefore m˙=150000500000100=3500 kg/s, meaning the engine burns 3500 kg of propellant every second.

The ideal (gravity-free) rocket equation gives the mission budget:

Δv=4500ln5000001500005418 m/s

Because the launch is vertical, gravity subtracts a steady loss over the burn equal to gtb=9.81×100981 m/s. The simulated burnout velocity is thus about 5418981=4437 m/s — noticeably below the ideal budget of 5418 m/s, which is exactly the “gravity loss” that makes vertical ascent so costly. After burnout the vehicle coasts upward, trading that kinetic energy for altitude (a further climb on the order of vburnout22g, roughly a thousand kilometers in a vacuum) before gravity pulls it back. Only a small fraction of the propellant's chemical energy ends up as vehicle kinetic energy, which the yellow and blue energy bars in the animation make visible.

6. Comparison table

The table compares the baseline design with two variations: one using higher exhaust velocity and another carrying less propellant. The ideal Δv values are computed directly from the rocket equation, Δv=veln(m0/mf), and gravity losses would reduce the actual burnout velocity below these figures. The baseline mass ratio is 5000001500003.33.

Scenario v_e (m/s) m₀ (kg) m_f (kg) Mass ratio m₀/m_f Ideal Δv (m/s)
Baseline 4500 500000 150000 3.33 5418
Higher v_e 5200 500000 150000 3.33 6261
Lighter payload 4500 400000 100000 4.00 6238

Increasing exhaust velocity or reducing final mass both raise the achievable Δv, but the animation shows their different impacts: higher ve steepens the velocity curve without changing burn duration, whereas lowering payload shortens the yellow fuel bar and produces a lighter vehicle that accelerates faster.

7. How to read the animation

The canvas plots altitude versus time. The horizontal axis stretches from zero to the chosen total time. The vertical axis rescales automatically to fit the highest altitude. A thin black rocket icon climbs as the simulation advances, leaving a faint trail of its trajectory. A red circle marks the current state. The yellow bar beneath the canvas indicates remaining propellant energy, shrinking as fuel burns; the blue bar shows kinetic energy gained. These patterned bars allow viewers with color‑vision deficiencies to distinguish them. Captions and a hidden text block describe the same numbers for screen readers. Keyboard users can focus the canvas and press the space bar to toggle play and pause.

8. Limitations

The model omits atmospheric drag, engine throttling, structural flex, staging, and relativity. Gravity remains constant even as altitude increases, which is reasonable only for short flights near Earth. Chemical energy is approximated rather than calculated from realistic propellant thermodynamics. Numerical integration assumes a rigid body and ignores rotational dynamics. These simplifications render the simulator a pedagogical tool rather than a mission design suite. Large time steps may introduce noticeable Δv drift, especially with extreme mass ratios; the reported error helps diagnose such issues.

9. Extensions

Future improvements could include variable thrust profiles, atmospheric drag models, staging events, or three‑dimensional trajectories. Implementing a symplectic integrator would conserve energy more faithfully during coast phases. Coupling the rocket to a planetary gravity field or adding an orbital display would transform the tool into a basic mission sandbox. Because the code uses only vanilla JavaScript and the HTML5 canvas, enthusiasts can experiment freely by editing the source.

Frequently asked rocket equation questions

What is the Tsiolkovsky rocket equation?

It gives the ideal change in velocity a rocket can achieve: delta-v equals the effective exhaust velocity multiplied by the natural logarithm of the mass ratio, the starting mass divided by the burnout mass. It assumes no gravity or drag, so it represents the velocity budget available to the vehicle rather than the speed actually reached during a launch.

Why is the actual burnout velocity lower than the rocket-equation delta-v?

Gravity and drag steal velocity during ascent. On a vertical launch, gravity subtracts roughly g times the burn time from the ideal delta-v. For the default vehicle that gravity loss is about 981 meters per second over a 100-second burn, so the simulated burnout velocity is near 4437 meters per second rather than the ideal 5418. Real launches also lose speed to atmospheric drag and steering.

Why does exhaust velocity matter so much?

Delta-v scales linearly with exhaust velocity but only logarithmically with the mass ratio. Doubling the exhaust velocity doubles the delta-v, while doubling the mass ratio adds far less. That is why engineers work hard on higher-efficiency engines, measured as specific impulse, since a small gain in exhaust velocity beats hauling ever more propellant.

What units does the calculator use?

Everything is in SI units: kilograms for mass, meters per second for velocity and exhaust velocity, and seconds for time. Keep all inputs consistent, ensure the initial mass exceeds the final mass, and set the total simulation time longer than the burn time so the coast phase is captured.

10. References and related tools

The Tsiolkovsky rocket equation and gravity-loss framework are standard results in astronautics; see, for example, NASA Glenn on the ideal rocket equation. Classical derivations of the rocket equation appear in standard texts such as J. R. Wertz, Spacecraft Attitude Determination and Control, and D. Vallado, Fundamentals of Astrodynamics and Applications. For additional practice explore the Rocket Engine Thrust Calculator, analyze free‑fall trajectories with the Ballistic Trajectory Calculator, or place satellites using the Orbital Period Calculator.

Enter parameters and press Play.
Simulation summary will appear here.

Delta-V Dispatch Mini-Game

Practice balancing propellant and mission demands. Drag the throttle slider (or use arrow keys) to match required Δv before each stage times out while accounting for efficiency hits, gravity losses, and drifting mass ratios drawn from the rocket equation.

Balance Δv reserve

Click to Play and clear as many stage windows as you can in 85 seconds.

Best run: 0