12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Large-Scale Exampleswere not the same size as H, fmincon would compute a preconditioner basedon some diagonal scaling matrices determined from the algorithm. Typically,this would not perform as well.Quadratic Minimization with Bound ConstraintsTo minimize a large-scale quadratic with upper and lower bounds, you canuse the quadprog function.The problem stored in the MAT-file qpbox1.mat is a positive definitequadratic, and the Hessian matrix H is tridiagonal, subject to upper (ub) andlower (lb) bounds.Step 1: Load the Hessian and define f, lb, and ub.load qpbox1 % Get Hlb = zeros(400,1); lb(400) = -inf;ub = 0.9*ones(400,1); ub(400) = inf;f = zeros(400,1); f([1 400]) = -2;Step 2: Call a quadratic minimization routine with a startingpoint xstart.xstart = 0.5*ones(400,1);[x,fval,exitflag,output] = ...quadprog(H,f,[],[],[],[],lb,ub,xstart);Looking at the resulting values of exitflag and output,exitflag =3output =iterations: 20algorithm: 'large-scale: reflective trust-region'firstorderopt: 9.6206e-006cgiterations: 1834message: [1x206 char]you can see that while convergence occurred in 20 iterations, the high numberof CG iterations indicates that the cost of the linear system solve is high. In2-65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!