Simulation
Starship Launch Trajectory and Control
A two-phase trajectory optimization followed by a forward dynamic launch simulation of SpaceX Starship, showing how a basic PID attitude control loop maintains stability against realistic wind, combustion and engine vibration disturbances from pad to LEO.
Links & Resources
The Problem
A multi-kilotonne rocket lifting off like an inverted pendulum, then accelerating through the atmosphere to supersonic speeds while chaotic aerodynamic forces try to tip it over — the physics of this are not obviously compatible with stability. Understanding why it works requires more than intuition.
Assumptions
The analysis starts from several accepted physical facts: Raptor engines produce over 2 MN of thrust per engine on methane-oxygen combustion; 13 of the 33 engines on the Super Heavy booster are gimballed and capable of 5 degrees per second of angular actuation; low-latency IMUs and GPS provide attitude estimates accurate to within 0.01 degrees; and Starship's control system performs at least as well as a basic 10 Hz PID loop. The simulation uses a 2D flat-Earth model, which is sufficient for the purpose of understanding the trajectory physics.
Two-Phase Trajectory Optimization
The first step finds the fuel-optimal trajectory for direct insertion into low Earth orbit. "Two-phase" refers to the separation of the Super Heavy booster from the Starship upper stage at Main Engine Cut-Off. The trajectory is decomposed into four phases: vertical ascent, turn-over maneuver, and two gravity-turn segments before and after MECO. Engine throttle and gimbal angle are the optimization control variables.
Forward Dynamic Simulation
The second step uses the optimized trajectory as a reference and introduces a realistic disturbance environment: turbulent wind speeds modelled with Von Karman's power spectral density function, thrust fluctuations from combustion instabilities, and engine vibrations — the latter two represented by stochastic models. A forward dynamic simulation of the full launch then runs the PID attitude controller against these disturbances.
The result is that for realistic disturbance amplitudes, even a simple 10 Hz proportional-integral-derivative controller keeps the rocket on target from liftoff to LEO without difficulty. The physics cooperates once the trajectory is well-designed and the actuators are fast enough.
What makes the real Starship impressive is not that it can be stabilized — that turns out to be tractable — but that it can be stabilized reliably enough to be reused, repeatedly, at increasing flight rates.