Similar Items: Nonlinear optimal control of the planar inverted pendulum