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.

fminbndThevalueattheminimumisy = f(x)y =-1If fun is parameterized, you can use anonymous functions to capturethe problem-dependent parameters. For example, suppose you want tominimize the objective function myfun defined by the following M-filefunction.function f = myfun(x,a)f = (x - a)^2;Note that myfun has an extra parameter a, soyoucannotpassitdirectlyto fminbind. To optimize for a specific value of a, suchasa = 1.5.1 Assign the value to a.a = 1.5; % define parameter first2 Call fminbnd with a one-argument anonymous function that capturesthat value of a and calls myfun with two arguments:x = fminbnd(@(x) myfun(x,a),0,1)Algorithmfminbnd is an M-file. The algorithm is based on golden section searchand parabolic interpolation. Unless the left endpoint x 1is very close tothe right endpoint x 2, fminbnd never evaluates fun at the endpoints,so fun need only be defined for x in the interval x 1< x < x 2. If theminimum actually occurs at x 1or x 2, fminbnd returns an interior pointatadistanceofnomorethan2*TolX from x 1or x 2,whereTolX is thetermination tolerance. See [1] or [2] for details about the algorithm.8-32

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

Saved successfully!

Ooh no, something went wrong!