Techniques to control flight of an aircraft are disclosed. In various embodiments, a set of inputs associated with a requested set of forces and moments to be applied to the aircraft is received. An optimal mix of actuators and associated actuator parameters to achieve to an extent practical the requested forces and moments is determined, including by minimizing a weighted set of costs that includes costs associated with one or more errors each corresponding to a difference between a requested force or moment and a corresponding force or moment achieved by the computed solution.