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.
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.
The rocket starts with mass , including structure, payload, and propellant. After the engines shut down, only remains. The exhaust velocity is the speed of propellant relative to the vehicle, assumed constant. Burn time specifies how long the engines fire, implying a constant mass flow rate . During the burn the rocket experiences thrust . Gravity acts downward with acceleration . 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 controls numerical accuracy. A smaller step increases computational load but better resolves rapid changes near burnout. The interface limits between 0.01 and 10 seconds to maintain stability. Total simulation time must exceed the burn time to capture coast. Input validation ensures mass values remain positive and that exceeds .
With the assumptions above, the system obeys a set of coupled firstāorder ordinary differential equations. Mass decreases linearly while engines fire: . Velocity changes according to thrust and gravity: during burn and after burnout. Altitude follows the kinematic relation . The analytic solution for velocity at burnout is the familiar rocket equation , which the simulation uses to monitor numerical error. Kinetic energy is , and we approximate chemical energy available as . Displaying both as bars emphasizes how little of the propellantās energy converts to motion.
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 . During burn the derivative function is ; afterward . The RK4 update is with , , and so on. RK4 remains stable for the relatively smooth dynamics of a rocket burn provided , a guideline enforced by clamping the user-selected step. After generating the time series, the code compares the final velocity against the analytic and reports the fractional error as āĪv drift,ā giving users a sense of numerical accuracy.
Suppose a test vehicle begins at and ends at , burning for with . The mass flow rate is . Entering these numbers with 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.
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 steepens the velocity curve without changing burn duration, whereas lowering payload shortens the yellow fuel bar and produces a lighter vehicle that accelerates faster.
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.
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.
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.
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.