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 Examplesfval =270.4790output =iterations: 9funcCount: 10cgiterations: 15firstorderopt: 7.5340e-005algorithm: 'large-scale: trust-region reflective Newton'message: [1x86 char]Nonlinear Minimization with Equality ConstraintsThe large-scale method for fmincon can handle equality constraints if noother constraints exist. Suppose you want to minimize the same objectiveas in Equation 2-7, which is coded in the function brownfgh.m, wheren =1000, such that for Aeq that has 100 equations (so Aeq is a100-by-1000 matrix).Step 1: Write an M-file brownfgh.m that computes theobjective function, the gradient of the objective, and the sparsetridiagonal Hessian matrix.As before, this file is rather long and is not included here. You can view thecode with the commandtype brownfghBecause brownfgh computes the gradient and Hessian values as well as theobjective function, you need to use optimset to indicate that this informationis available in brownfgh, usingtheGradObj and Hessian options.ThesparsematrixAeq and vector beq are available in the file browneq.mat:load browneqThe linear constraint system is 100-by-1000, has unstructured sparsity (usespy(Aeq) to view the sparsity structure), and is not too badly ill-conditioned:condest(Aeq*Aeq')ans =2-59

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

Saved successfully!

Ooh no, something went wrong!