A multivariable nonlinear algebraic loop as a QP with applications to MPC