About Me

Getting a rocket to orbit

This page is from a project inspired by chapter 1 of "Computational Physics", a book we'll be working out of for the class of the same name in my last year of the Physics BS program.

In it's current state, the interactivity is limited to just modifying a few flight parameters like how long the engines are lit for. But, for the near future, I plan to add:

  • Interactive 3D plot: drag and drop functionality for the orbital trajectories.
  • Payload selector: see the effects of adding mass to a spacecraft by computing the highest possible orbit for a given payload.
  • Project background:

    The code began as a simple 1D example where a rocket takes off and flies purely upward. It consisted of only "for" loops in Python and originally just used equations of motion with known parameters for Starship.

    I then increased the complexity of the simulation, adding in elements for aerodynamic drag and moved to 2D. I also added in the stage separation event, and created separate events for the stage 2 initial burn, coast phase, and insertion burn.

    Coding Slide 1

    How the trajectory is calculated

    The nominal flight path to a particular orbit is currently above my paygrade, so for now the flight path is calculated via the following steps:

  • Stage 1 follows a gravity turn trajectory, with the thrust vector set to minimize gravity losses.
  • Stage 2 is separated into 2 different burns, and a coast phase. The first burn is to gain enough altitude, and reaches a perpendicular thrust vector by the end of the burn. The second burn is to circularize, and burns perpendicular to Earth surface for the entire duration.
  • Known deficiencies:

    This is still very much a work in progress. Currently, the selectable parameters are not particularly illustrative of the complexities of getting the rocket to orbit.

    The simulation itself is lacking a meaningful control of pitch direction, as it uses simplistic angle-changes to change direction. That makes it limited to just the one orbital inclination for now. The aerodynamic model is also most likely underestimating the contribution of drag at hypersonic speeds.

    Explanation of parameters:

  • Vertical velocity before pitch change: how much the vertical velocity to gain from launch until the rocket begins pitching over.
  • Percentage of dV for stage 2: controls how much dV is spent for the initial stage 2 burn. The remainder will be spent after the specified coast time.
  • Coast time: how long is spent between the two burns of the second stage.
  • Below the simulation, I walk through the steps of putting this code together, and the physical consequences of each input.

    Input Parameters