Skip to content

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.

ItemDefinition
StatesHorizontal and vertical velocities u,vu,v; position x,yx,y
ControlAcceleration angle β\beta from horizontal
ObjectiveMinimize tft_f
PhasesOne phase, 20 nodes, free final time
New conceptsTwo-dimensional motion and direction as a control

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 a=1a=1 m/s².
  • The vehicle starts at rest and must finish at y=1y=1 m with u=1u=1 m/s and v=0v=0.
  • 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.

u˙=acos⁡β,v˙=asin⁡β,x˙=u,y˙=v.\dot u=a\cos\beta,\qquad\dot v=a\sin\beta,\qquad\dot x=u,\qquad\dot y=v.

Angle β=0\beta=0 points horizontally forward; 90∘90^\circ points up; negative angles point downward.

u(0)=v(0)=x(0)=y(0)=0,u(tf)=1,v(tf)=0,y(tf)=1.u(0)=v(0)=x(0)=y(0)=0,\qquad u(t_f)=1,\quad v(t_f)=0,\quad y(t_f)=1.

There is no condition on x(tf)x(t_f).

−π2≤β≤π2,J=tf,a=1 m/s2.-\frac\pi2\le\beta\le\frac\pi2,\qquad J=t_f,\qquad a=1\ \mathrm{m/s^2}.

The acceleration direction stays in the forward half-plane.

For time 0 to 2 s, let s=t/2s=t/2:

  • u=su=s and x=s2x=s^2.
  • y=3s2−2s3y=3s^2-2s^3 and v=3s(1−s)v=3s(1-s).
  • β=arctan⁡(3(1−2s))\beta=\arctan\bigl(3(1-2s)\bigr), turning from upward to downward.
Trajectory in blue, node positions in white, and acceleration directions as orange arrows. A black circle and square mark the start and finish.
Trajectory in blue, node positions in white, and acceleration directions as orange arrows. A black circle and square mark the start and finish.
Position x and height y (top), horizontal and vertical velocities (middle), and acceleration angle β (bottom). Red dotted lines mark ±90°.
Position x and height y (top), horizontal and vertical velocities (middle), and acceleration angle β (bottom). Red dotted lines mark ±90°.
The vehicle's trajectory and direction beside velocity and angle histories. The black vertical cursor marks the current time.
  • 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°).

Early acceleration points almost upward to build vertical speed. Later it points downward to cancel that speed exactly at y=1y=1. Horizontal speed grows most rapidly around the middle, when β\beta 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.

For this problem, optimal steering has the form

tan⁡β(t)=c1−c2t.\tan\beta(t)=c_1-c_2t.

This linear tangent law underlies practical rocket guidance. The free final horizontal position makes the denominator constant in this case. The computed tan⁡β\tan\beta is almost linear, while β\beta 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.

  • 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.
Terminal window
uv run python examples/06_simple_rocket_2d.py

View the Python source on GitHub.