Optimization Toolbox    

Quadratic Minimization with Bound Constraints

To minimize a large-scale quadratic with upper and lower bounds, you can use the quadprog function.

The problem stored in the MAT-file qpbox1.mat is a positive definite quadratic, and the Hessian matrix H is tridiagonal, subject to upper (ub) and lower (lb) bounds.

Step 1: Load the Hessian and define f, lb, ub.

Step 2: Call a quadratic minimization routine with a starting point xstart.

Looking at the resulting values of exitflag and output,

you can see that while convergence occurred in 20 iterations, the high number of CG iterations indicates that the cost of the linear system solve is high. In light of this cost, one strategy would be to limit the number of CG iterations per optimization iteration. The default number is the dimension of the problem divided by two, 200 for this problem. Suppose you limit it to 50 using the MaxPCGIter flag in options:

This time convergence still occurs and the total number of CG iterations (1547) has dropped:

A second strategy would be to use a direct solver at each iteration by setting the PrecondBandWidth parameter to inf:

Now the number of iterations has dropped to 10:

Using a direct solve at each iteration usually causes the number of iterations to decrease, but often takes more time per iteration. For this problem, the tradeoff is beneficial, as the time for quadprog to solve the problem decreases by a factor of 10.


  Nonlinear Minimization with a Dense but Structured Hessian and Equality Constraints Quadratic Minimization with a Dense but Structured Hessian