What Is Optimization Toolbox?

What Is Optimization Toolbox? What Is Optimization Toolbox?

cda.psych.uiuc.edu
from cda.psych.uiuc.edu More from this publisher
12.07.2015 Views

2 Tutorialexitflag =3output =iterations: 18algorithm: 'large-scale: reflective trust-region'firstorderopt: 0.0028cgiterations: 50message: [1x206 char]After 18 iterations with a total of 30 PCG iterations, the function value isreduced tofval =-1.0538e+003and the first-order optimality isoutput.firstorderopt =0.0043PreconditioningIn this example, quadprog cannot use H to compute a preconditioner becauseH only exists implicitly. Instead, quadprog uses B, the argument passed ininstead of H, to compute a preconditioner. B is a good choice because it is thesame size as H and approximates H to some degree. If B were not the samesize as H, quadprog would compute a preconditioner based on some diagonalscaling matrices determined from the algorithm. Typically, this would notperform as well.Because the preconditioner is more approximate than when H is availableexplicitly, adjusting the TolPcg parameter to a somewhat smaller valuemightberequired.Thisexampleisthesame as the previous one, but reducesTolPcg from the default 0.1 to 0.01.function [fval, exitflag, output, x] = runqpbox4prec2-70

Large-Scale Examples% RUNQPBOX4PREC demonstrates 'HessMult' option for QUADPROG% with bounds.problem = load('qpbox4'); % Get xstart, u, l, B, A, fxstart = problem.xstart; u = problem.u; l = problem.l;B = problem.B; A = problem.A; f = problem.f;mtxmpy = @qpbox4mult; % function handle to qpbox4mult nestedsubfunction% Choose the HessMult option% Override the TolPCG optionoptions = optimset('HessMult',mtxmpy,'TolPcg',0.01);% Pass B to qpbox4mult via the H argument. Also, B will be% used in computing a preconditioner for PCG.% A is passed as an additional argument after 'options'[x, fval, exitflag, output] =quadprog(B,f,[],[],[],[],l,u,xstart,options);endfunction W = qpbox4mult(B,Y);%QPBOX4MULT Hessian matrix product with dense%structured Hessian.% W = qpbox4mult(B,Y) computes W = (B + A*A')*Y where% INPUT:% B - sparse square matrix (512 by 512)% Y - vector (or matrix) to be multiplied by B + A'*A.% VARIABLES from outer function runqpbox4:% A - sparse matrix with 512 rows and 10 columns.%% OUTPUT:% W - The product (B + A*A')*Y.end% Order multiplies to avoid forming A*A',% which is large and denseW = B*Y + A*(A'*Y);Now, enter2-71

2 Tutorialexitflag =3output =iterations: 18algorithm: 'large-scale: reflective trust-region'firstorderopt: 0.0028cgiterations: 50message: [1x206 char]After 18 iterations with a total of 30 PCG iterations, the function value isreduced tofval =-1.0538e+003and the first-order optimality isoutput.firstorderopt =0.0043PreconditioningIn this example, quadprog cannot use H to compute a preconditioner becauseH only exists implicitly. Instead, quadprog uses B, the argument passed ininstead of H, to compute a preconditioner. B is a good choice because it is thesame size as H and approximates H to some degree. If B were not the samesize as H, quadprog would compute a preconditioner based on some diagonalscaling matrices determined from the algorithm. Typically, this would notperform as well.Because the preconditioner is more approximate than when H is availableexplicitly, adjusting the TolPcg parameter to a somewhat smaller valuemightberequired.Thisexampleisthesame as the previous one, but reducesTolPcg from the default 0.1 to 0.01.function [fval, exitflag, output, x] = runqpbox4prec2-70

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

Saved successfully!

Ooh no, something went wrong!