beginning flapping traj opt