A.3 Quadratic Programming Solver
A convenience wrapper function called qps_mips is provided to make it trivial to set up
and solve linear programming (LP) and quadratic programming (QP) problems of the
following form:
| (A.11) |
subject to
Instead of a function handle, the objective function is specified in terms of the paramters
and of quadratic cost coefficients. Internally, qps_mips passes mips the handle of a
function that uses these paramters to evaluate the objective function, gradients and
Hessian.
The calling syntax for qps_mips is similar to that used by quadprog from the Matlab
Optimization Toolbox.
[x, f, exitflag, output, lambda] = qps_mips(H, c, A, l, u, xmin, xmax, x0, opt);
Alternatively, the input arguments can be packaged as fields in a problem struct and passed in
as a single argument, where all fields except H, c, A and l are optional.
[x, f, exitflag, output, lambda] = qps_mips(problem);
Aside from H and c, all input and output arguments correspond exactly to the same
arguments for mips as described in Tables A-1 and A-2.
As with mips and fmincon, the primary difference between the calling syntax for
qps_mips and quadprog is that the linear constraints are specified in terms of a single
doubly-bounded linear function () as opposed to separate equality constrained
() and upper bounded () functions.
Matpower also includes another wrapper function qps_matpower that provides a
consistent interface for all of the QP and LP solvers it has available. This interface is
identical to that used by qps_mips with the exception of the structure of the opt input
argument. The solver is chosen according to the value of opt.alg. See the help for
qps_matpower for details.
Several examples of using qps_matpower to solve LP and QP problems can be found in
t_qps_matpower.m.