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.

2 Tutoriallight of this cost, one strategy would be to limit the number of CG iterationsper optimization iteration. The default number is the dimension of theproblem divided by two, 200 for this problem. Suppose you limit it to 50 usingthe MaxPCGIter flag in options:options = optimset('MaxPCGIter',50);[x,fval,exitflag,output] = ...quadprog(H,f,[],[],[],[],lb,ub,xstart,options);This time convergence still occurs and the total number of CG iterations(1547) has dropped:exitflag =3output =iterations: 36algorithm: 'large-scale: reflective trust-region'firstorderopt: 2.3821e-005cgiterations: 1547message: [1x206 char]A second strategy would be to use a direct solver at each iteration by settingthe PrecondBandWidth option to inf:options = optimset('PrecondBandWidth',inf);[x,fval,exitflag,output] = ...quadprog(H,f,[],[],[],[],lb,ub,xstart,options);Now the number of iterations has dropped to 10:exitflag =3output =iterations: 10algorithm: 'large-scale: reflective trust-region'firstorderopt: 1.2319e-006cgiterations: 9message: [1x206 char]Using a direct solver at each iteration usually causes the number of iterationsto decrease, but often takes more time per iteration. For this problem, the2-66

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

Saved successfully!

Ooh no, something went wrong!