Skip to content

Examples

Examples are ordered from simple to advanced. Each covers one physical model and one objective, with parameters, problem construction, solving, and plotting in a single Python file.

Each page explains the situation and equations before showing the computed figures and videos. Dots are optimized node values; curves are interpolating polynomials. Black dashed curves show analytic solutions where available.

Basics: motion on a line and fastest descent

Section titled “Basics: motion on a line and fastest descent”

Small problems with few states and controls, suitable for learning the formulation and comparing with hand calculations.

Introduce changing mass, drag, phase splitting, and stage separation.

Two-dimensional flight into and between Earth orbits, with scaling and more constraints.

Run from the repository root after installing the environment:

Terminal window
uv run python examples/07_goddard_0knot.py

Change the values in each script’s PARAMETERS dictionary or Rocket class to solve with different conditions. The scripts retain their original Japanese comments; these pages explain the models in English.