Controller using Quadratic programming formulations