A method for controlling a machine by solving a convex quadratic program (QP) for a convex set, wherein constraints of the QP include a set of linear equalities and a set of linear inequalities, wherein the solving uses an Alternating Direction Method of Multipliers (ADMM), wherein variables of the convex QP include a linear subspace constrained variable vector and a set constrained variable vector indicating desired behavior of the machine, comprising iterative steps:
- solving, using a processor, the linear subspace constrained variable vector while keeping the set constrained variable vector fixed using an optimal step size and a Lagrangian multiplier, wherein the optimal step size is determined as a square root of a product of minimum and maximum eigenvalues of a Hessian matrix of the QP problem pre- and post multiplied by an orthonormal basis for a null space of a linear equality constraint matrix;
- solving, using the processor, the set of constrained variable vector while keeping the linear subspace constrained variable vector fixed using the optimal step size and the Lagrangian multiplier;
- updating the Lagrangian multiplier;
- repeating for a next iteration until either a termination condition for a feasible solution is satisfied or a termination condition for an infeasible solution is satisfied to produce a QP solution including one or combination of values of the linear subspace constrained variable vector and the set of constrained variable vector;
- and
- controlling the machine using the OP solution.