12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 Tutorialexitflag =3fval =270.4790output =iterations: 7funcCount: 8cgiterations: 18firstorderopt: 0.0163algorithm: 'large-scale: trust-region reflective Newton'message: [1x86 char]For bound constrained problems, the first-order optimality is the infinitynorm of v.*g, wherev is defined as in “Box Constraints” on page 4-10, and gis the gradient.Because of the five-banded center stripe, you can improve the solutionby using a five-banded preconditioner instead of the default diagonalpreconditioner. Using the optimset function, reset the PrecondBandWidthparameter to 2 and solve the problem again. (The bandwidth is the number ofupper (or lower) diagonals, not counting the main diagonal.)fun = @tbroyfg;load tbroyhstr% Get Hstr, structure of the Hessiann = 800;xstart = -ones(n,1); xstart(2:2:n,1) = 1;lb = -10*ones(n,1); ub = -lb;options = optimset('GradObj','on','HessPattern',Hstr, ...'PrecondBandWidth',2);[x,fval,exitflag,output] = ...fmincon(fun,xstart,[],[],[],[],lb,ub,[],options);The number of iterations actually goes up by two; however the total numberof CG iterations drops from 18 to 15. The first-order optimality measure isreduced by a factor of 1e-3:exitflag =32-58

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

Saved successfully!

Ooh no, something went wrong!