Rocket Equation Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

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

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 m_0 , including structure, payload, and propellant. After the engines shut down, only m_f remains. The exhaust velocity v_e is the speed of propellant relative to the vehicle, assumed constant. Burn time t_b specifies how long the engines fire, implying a constant mass flow rate \dot m = m_f - m_0 t_b . During the burn the rocket experiences thrust F = v_e (-\dot m) . Gravity acts downward with acceleration g = 9.81 \,\text{m/s}^2. 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. These simplifications match the assumptions of the classical rocket equation while still allowing an engaging visualization.

Time step \Delta t controls numerical accuracy. A smaller step increases computational load but better resolves rapid changes near burnout. The interface limits \Delta t between 0.01 and 10 seconds to maintain stability. Total simulation time T must exceed the burn time to capture coast. Input validation ensures mass values remain positive and that m_0 exceeds m_f .

3. Governing equations

With the assumptions above, the system obeys a set of coupled first‑order ordinary differential equations. Mass decreases linearly while engines fire: < mfrac=""> = \dot m . Velocity changes according to thrust and gravity: < mfrac=""> = <="" mfrac=""> - g during burn and < mfrac=""> = - g after burnout. Altitude follows the kinematic relation < mfrac=""> = v . The analytic solution for velocity at burnout is the familiar rocket equation \Delta v = v_e ln < mfrac<="" mrow=""> , which the simulation uses to monitor numerical error. Kinetic energy is E_k = < mfrac=""> m v^2 , and we approximate chemical energy available as E_p = < mfrac="">(m_0-m_f)\,v_e^2 . 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. For each step the algorithm evaluates the derivatives at four intermediate points and forms a weighted average. Let \mathbf{x} = ( m , v , y ) . During burn the derivative function is f (\mathbf{x}) = (\dot m,\mfrac{-\dot m\,v_e}{m}-g,v) ; afterward f (\mathbf{x}) = (0,-g,v) . The RK4 update is \mathbf{x}_{n+1} = \mathbf{x}_n + <="">(\mathbf{k}_1+2\mathbf{k}_2+2\mathbf{k}_3+\mathbf{k}_4) with =f(\mathbf{x}_n) , =f(\mathbf{x}_n+\frac{\Delta t}{2}\mathbf{k}_1) , and so on. RK4 remains stable for the relatively smooth dynamics of a rocket burn provided <\tfrac{t_b}{20} , a guideline enforced by clamping the user-selected step. After generating the time series, the code compares the final velocity against the analytic v_e\ln\frac{m_0}{m_f} and reports the fractional error as ā€œĪ”v drift,ā€ giving users a sense of numerical accuracy.

5. Worked example

Suppose a test vehicle begins at m_0 = 500000 \,\text{kg} and ends at m_f = 150000 \,\text{kg}, burning for t_b = 100 \,\text{s} with v_e = 4500 \,\text{m/s}. The mass flow rate is |\dot m| = < mfrac=""> = 3500 \,\text{kg/s} . Entering these numbers with \Delta t = 0.1 \,\text{s} and total time 150 s, the simulation reveals a burnout velocity of roughly 5418 m/s, matching the rocket equation. Altitude peaks near 390 km before gravity pulls the vehicle back. The yellow fuel bar shrinks linearly during burn, while the blue kinetic bar grows quadratically; by the end only about 5% of the estimated chemical energy becomes motion, underscoring rocket inefficiency. Pressing the CSV button downloads columns of time, mass, velocity, altitude, kinetic energy, and Δv error so you can verify calculations in a spreadsheet.

6. Comparison table

The table compares the baseline design with two variations: one using higher exhaust velocity and another carrying less propellant. Values extracted from the simulation illustrate the trade-offs.

Scenario v_e (m/s) m₀ (kg) m_f (kg) Burnout Δv (m/s) Peak altitude (km)
Baseline 4500 500000 150000 5418 390
Higher v_e 5200 500000 150000 6266 515
Lighter payload 4500 400000 100000 6023 470

Increasing exhaust velocity or reducing final mass both raise the achievable Δv, but the animation shows their different impacts: higher v_e 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.

10. References and related tools

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.

Embed this calculator

Copy and paste the HTML below to add the Rocket Equation Simulator to your website.