What Is Optimization Toolbox?

What Is Optimization Toolbox? What Is Optimization Toolbox?

cda.psych.uiuc.edu
from cda.psych.uiuc.edu More from this publisher
12.07.2015 Views

fgoalattainnonlconThe function that computes the nonlinear inequalityconstraints c(x)

fgoalattainfunction [c,ceq,GC,GCeq] = mycon(x)c = ...% Nonlinear inequalities at xceq = ...% Nonlinear equalities at xif nargout > 2 % Nonlcon called with 4 outputsGC = ...% Gradients of the inequalitiesGCeq = ... % Gradients of the equalitiesendIf nonlcon returns a vector c of m components and x haslength n, wheren is the length of x0, then the gradient GCof c(x) is an n-by-m matrix, where GC(i,j) is the partialderivative of c(j) with respect to x(i) (i.e., the jth columnof GC is the gradient of the jth inequality constraintc(j)). Likewise, if ceq has p components, the gradientGCeq of ceq(x) is an n-by-p matrix, where GCeq(i,j) isthe partial derivative of ceq(j) with respect to x(i) (i.e.,the jth column of GCeq is the gradient of the jth equalityconstraint ceq(j)).Note Because the functions in Optimization Toolbox onlyaccept inputs of type double, user-supplied objective andnonlinear constraint functions must return outputs of typedouble.options“Avoiding Global Variables viaAnonymousandNestedFunctions” on page 2-20 explains how to parameterize thenonlinear constraint function nonlcon, if necessary.“Options” on page 8-20 provides the function-specificdetails for the options values.8-17

fgoalattainfunction [c,ceq,GC,GCeq] = mycon(x)c = ...% Nonlinear inequalities at xceq = ...% Nonlinear equalities at xif nargout > 2 % Nonlcon called with 4 outputsGC = ...% Gradients of the inequalitiesGCeq = ... % Gradients of the equalitiesendIf nonlcon returns a vector c of m components and x haslength n, wheren is the length of x0, then the gradient GCof c(x) is an n-by-m matrix, where GC(i,j) is the partialderivative of c(j) with respect to x(i) (i.e., the jth columnof GC is the gradient of the jth inequality constraintc(j)). Likewise, if ceq has p components, the gradientGCeq of ceq(x) is an n-by-p matrix, where GCeq(i,j) isthe partial derivative of ceq(j) with respect to x(i) (i.e.,the jth column of GCeq is the gradient of the jth equalityconstraint ceq(j)).Note Because the functions in <strong>Optimization</strong> <strong>Toolbox</strong> onlyaccept inputs of type double, user-supplied objective andnonlinear constraint functions must return outputs of typedouble.options“Avoiding Global Variables viaAnonymousandNestedFunctions” on page 2-20 explains how to parameterize thenonlinear constraint function nonlcon, if necessary.“Options” on page 8-20 provides the function-specificdetails for the options values.8-17

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

Saved successfully!

Ooh no, something went wrong!