Skip to main content
TSI

TSI

A command-line rocket staging optimizer. Named after Tsiolkovsky, the father of astronautics.

The Problem

Designing a rocket is an optimization problem. Given a payload mass and a target delta-v, what's the best way to split propellant between stages? How many engines per stage? Which engines?

The math isn't hard—Tsiolkovsky wrote the equation in 1903. But running the calculations by hand gets tedious, and spreadsheets become unmaintainable once you add constraints like minimum thrust-to-weight ratios.

I wanted a tool that could answer staging questions quickly, with real engine data, and show its work.

TSI staging optimization output

What TSI Does

TSI is a Rust CLI that solves rocket staging problems. Give it a payload and target delta-v, and it finds the optimal stage configuration.

# Optimize a two-stage rocket to orbit
tsi optimize --payload 5000 --target 9400

# Calculate single-stage performance
tsi calculate --engine raptor-2 --propellant 100000

# Browse the engine database
tsi engines --propellant LOX/CH4

The optimizer respects real-world constraints: minimum TWR for liftoff, engine count limits, propellant type matching. It picks from a database of 11 real engines—Merlin, Raptor, RS-25, and others.

TSI engine database

Type-Safe Physics

Rocket calculations are unit-heavy. Mass in kilograms, velocity in meters per second, thrust in newtons, ISP in seconds. Mix them up and you get nonsense—or worse, you get a number that looks plausible but is wrong by a factor of 9.8.

TSI uses Rust's type system to catch unit errors at compile time:

let mass: Mass = Mass::kg(10_000.0);
let velocity: Velocity = Velocity::mps(3_000.0);

// This won't compile—can't add mass and velocity
let nonsense = mass + velocity;

// This computes delta-v correctly
let dv = physics::delta_v(isp, mass_ratio);

The newtype pattern wraps primitives in domain types. Operations that make physical sense are defined; everything else is a compile error.

Monte Carlo Analysis

A single optimization gives you a point estimate. But real rockets have uncertainty—ISP varies with manufacturing tolerances, propellant loading isn't exact, structural mass estimates drift.

TSI runs Monte Carlo simulations to quantify this:

tsi optimize --payload 5000 --target 9400 --monte-carlo 1000

It samples from distributions around nominal values, runs the optimization for each sample, and reports confidence intervals. You can see not just "will this design work?" but "what's the probability it works?"

TSI single-stage calculation

Building It

Started as a weekend project to learn Rust. The first version was a single file that could barely compute delta-v. Then I wanted to add staging. Then engine selection. Then Monte Carlo.

The test suite grew alongside the code. 168 tests now, including property-based tests that check physical invariants (delta-v is always positive, heavier payloads always reduce it) and validation tests that compare against real rocket performance data.

Rayon handles parallelization for Monte Carlo runs. A thousand iterations finish in under a second.

What's Next

Better atmospheric loss modeling. The current version estimates gravity drag and aerodynamic losses with simple heuristics. A proper trajectory simulation would be more accurate, but that's a bigger project.

More engines, more propellant types. Maybe a TUI for interactive exploration.

Share:

© 2026 Oddur Sigurdsson