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.

Large-Scale Examples3 16 0.0458181 1.3279 0.579 14 21 0.000101184 0.0631898 0.0203 25 26 3.16615e-007 0.00273698 0.00079 26 31 9.72482e-010 0.00018111 5.82e-005 2<strong>Optimization</strong> terminated successfully:Relative function value changing by less than OPTIONS.TolFunAlternatively, it is possible to choose a sparse direct linear solver (i.e., a sparseQR factorization) by indicating a “complete” preconditioner. For example, ifyou set PrecondBandWidth to Inf, then a sparse direct linear solver is usedinstead of a preconditioned conjugate gradient iteration:xstart = -ones(1000,1);fun = @nlsf1a;load nlsdat1 % Get Jstroptions = optimset('Display','iter','JacobPattern',Jstr,...'LargeScale','on','PrecondBandWidth',inf);[x,fval,exitflag,output] = fsolve(fun,xstart,options);and the resulting display isNorm of First-order CG-Iteration Func-count f(x) step optimality Iterations1 6 1011 1 19 02 11 15.9018 7.92421 1.89 13 16 0.0128163 1.32542 0.0746 14 21 1.73538e-008 0.0397925 0.000196 15 26 1.13169e-018 4.55544e-005 2.76e-009 1<strong>Optimization</strong> terminated successfully:Relative function value changing by less than OPTIONS.TolFunWhenthesparsedirectsolversareused,theCGiterationis1forthat(major)iteration, as shown in the output under CG-Iterations. Notice that the finaloptimality and f(x) value (which for fsolve, f(x), is the sum of the squares ofthe function values) are closer to zero than using the PCG method, whichis often the case.2-49

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

Saved successfully!

Ooh no, something went wrong!