06. A simple two-dimensional rocket
A vehicle can change its acceleration direction but not its magnitude. Starting at rest, how can it reach horizontal flight at height 1 m as quickly as possible? This is a simplified rocket guidance problem without gravity or air.
| Item | Definition |
|---|---|
| States | Horizontal and vertical velocities ; position |
| Control | Acceleration angle from horizontal |
| Objective | Minimize |
| Phases | One phase, 20 nodes, free final time |
| New concepts | Two-dimensional motion and direction as a control |
Situation
Section titled “Situation”Orbital ascent requires building height, then horizontal speed, and reaching the target with no vertical velocity. Here we isolate the steering question:
- Motion is planar, without gravity or drag.
- Acceleration magnitude is fixed at m/s².
- The vehicle starts at rest and must finish at m with m/s and .
- Final horizontal position is free.
Accelerating only upward gains height but leaves vertical speed and no horizontal speed. Accelerating only sideways gains no height. Steering must meet both requirements together.
Formulation
Section titled “Formulation”Dynamics
Section titled “Dynamics”Angle points horizontally forward; points up; negative angles point downward.
Boundary conditions
Section titled “Boundary conditions”There is no condition on .
Constraints, objective, and parameter
Section titled “Constraints, objective, and parameter”The acceleration direction stays in the forward half-plane.
Initial guess
Section titled “Initial guess”For time 0 to 2 s, let :
- and .
- and .
- , turning from upward to downward.
Results
Section titled “Results”

- Minimum duration: 2.085 s.
- Final horizontal position: 1.043 m.
- Angle varies smoothly from 1.35 rad (about 77°) to -1.34 rad (about −77°).
Explanation
Section titled “Explanation”Gain height, then cancel vertical speed
Section titled “Gain height, then cancel vertical speed”Early acceleration points almost upward to build vertical speed. Later it points downward to cancel that speed exactly at . Horizontal speed grows most rapidly around the middle, when passes through zero. The fixed acceleration is allocated between reaching the height target and reaching 1 m/s horizontally. Without gravity, the upward and downward portions are nearly symmetric.
The linear tangent law
Section titled “The linear tangent law”For this problem, optimal steering has the form
This linear tangent law underlies practical rocket guidance. The free final horizontal position makes the denominator constant in this case. The computed is almost linear, while itself forms an S-shaped curve, changing slowly near its endpoints and quickly near the middle. The initial guess has the same general form.
Indirect methods derive this property from optimality conditions. OpenGoddard obtains it directly from the dynamics and constraints without requiring the steering law in advance.
Try it
Section titled “Try it”- Set
PARAMETERS["a"]to 2 and compare duration, trajectory, and steering. - Add a final horizontal-position equality. The tangent of the steering angle is no longer a linear function of time.
- Change the node count from 20 to 10 or 40 and compare the stable digits of the minimum duration.
uv run python examples/06_simple_rocket_2d.py