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.






Rocket ascent and landing
Section titled “Rocket ascent and landing”Introduce changing mass, drag, phase splitting, and stage separation.





Orbital insertion and transfer
Section titled “Orbital insertion and transfer”Two-dimensional flight into and between Earth orbits, with scaling and more constraints.




Running the examples
Section titled “Running the examples”Run from the repository root after installing the environment:
uv run python examples/07_goddard_0knot.pyChange 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.