Optimization-based control for flight vehicles