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 Tutorialoptimset('Display','iter','LargeScale','on','Jacobian','on');[x,fval,exitflag,output] = fsolve(fun,xstart,options);A starting point is given as well as the function name. The default method forfsolve is medium-scale, so it is necessary to specify 'LargeScale' as 'on' inthe options argument. Setting the Display option to 'iter' causes fsolveto display the output at each iteration. Setting Jacobian to 'on', causesfsolve to use the Jacobian information available in nlsf1.m.The commands display this output:Norm of First-order CG-Iteration Func-count f(x) step optimality Iterations1 2 1011 1 19 02 3 16.1942 7.91898 2.35 33 4 0.0228027 1.33142 0.291 34 5 0.000103359 0.0433329 0.0201 45 6 7.3792e-007 0.0022606 0.000946 46 7 4.02299e-010 0.000268381 4.12e-005 5<strong>Optimization</strong> terminated successfully:Relative function value changing by less than OPTIONS.TolFunA linear system is (approximately) solved in each major iteration usingthe preconditioned conjugate gradient method. The default value forPrecondBandWidth is 0 in options, so a diagonal preconditioner is used.(PrecondBandWidth specifies the bandwidth of the preconditioning matrix. Abandwidth of 0 means there is only one diagonal in the matrix.)From the first-order optimality values, fast linear convergence occurs. Thenumber of conjugate gradient (CG) iterations required per major iteration islow, at most five for a problem of 1000 dimensions, implying that the linearsystems are not very difficult to solve in this case (though more work isrequired as convergence progresses).It is possible to override the default choice of preconditioner (diagonal)by choosing a banded preconditioner through the use of the optionPrecondBandWidth. If you want to use a tridiagonal preconditioner, i.e.,a preconditioning matrix with three diagonals (or bandwidth of one), setPrecondBandWidth to the value 1:options = optimset('Display','iter','Jacobian','on',...2-46

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

Saved successfully!

Ooh no, something went wrong!