Introduction
OpenGoddard is a Python library for finding the best way to choose inputs that change over time, such as the thrust and flight direction of a launch vehicle. These are optimal control problems.
What problems does it solve?
Section titled “What problems does it solve?”Imagine releasing a ball from rest at point A and letting gravity carry it along a frictionless track to B. If you can choose the shape of the track, which shape gets the ball to B fastest?

A straight track gives the shortest distance but accelerates the ball slowly. A track that goes too deep adds too much distance. The fastest curve balances these effects: a steep initial descent builds speed, which then carries the ball horizontally.
The unknown is a function describing the track, rather than a single number. For a rocket, the unknowns are thrust magnitude and direction at each instant; for a car, they are throttle and brake inputs over time. OpenGoddard solves these problems from:
- Dynamics: how inputs change the state, such as position, velocity, and mass.
- Conditions: the initial and final states, and limits that must hold along the way.
- Objective: what to minimize, such as time, fuel use, or negative final altitude.
The result is a time history of states and controls. The following solution maximizes the mass delivered by a two-stage rocket to a 500 km circular orbit (Example 13).

Features
Section titled “Features”- LGL pseudospectral discretization gives high accuracy with relatively few nodes (pseudospectral methods).
- Write the equations directly as ordinary Python functions. The library assembles the discretization and optimization problem (writing a problem).
- Multiple phases support changes such as stage separation, with separate dynamics in each phase.
- NumPy, SciPy, and Matplotlib are the only required dependencies. The default optimizer is SciPy’s SLSQP (sequential quadratic programming).
Installation
Section titled “Installation”Python 3.11 or later is required.
pip install OpenGoddardTo run the examples, clone the repository and prepare the environment with uv:
git clone https://github.com/istellartech/OpenGoddard.gitcd OpenGoddarduv syncuv run python examples/02_move_stop.pyReading this site
Section titled “Reading this site”If you are learning optimal control and numerical optimization, follow these pages in order.
The name
Section titled “The name”The library is named after Robert H. Goddard. His 1919 question of how to vary thrust to reach the greatest altitude with a fixed amount of propellant is a classic optimal control problem (Example 07).
OpenGoddard is released by Interstellar Technologies Inc. under the MIT license.