1. A method for solving a control problem for an application, comprising the steps of: formulating, over a predetermined time interval, the control problem with a quadratic cost function, linear state equations and control constraints as a quadratic program for the application; and applying an update law to an optimization variable vector, starting from a positive initial estimate to obtain control actions for the application, wherein the update law is constructed from the quadratic program, wherein the steps are performed in a processor.