Main Content

Problem-Based Global Optimization Setup

Create optimization variables, create problem with objective and constraints, call solve

Global Optimization Toolbox has two approaches for optimization: problem-based and solver-based. See Decide Between Problem-Based and Solver-Based Approach. In problem-based optimization, you create symbolic-style optimization variables. Then you create expressions in these variables that represent the objective and constraints. Finally, solve the problem using solve. For details, see Problem-Based Optimization Workflow.

Note: If you have a nonlinear function that is not composed of polynomials, rational expressions, and elementary functions such as exp, then convert the function to an optimization expression by using fcn2optimexpr. See Convert Nonlinear Function to Optimization Expression and Supported Operations for Optimization Variables and Expressions.

For a basic example, see Compare Several Global Solvers, Problem-Based.


expand all

optimproblemCreate optimization problem
optimvaluesCreate values for optimization problem (Since R2022a)
optimvarCreate optimization variables
showDisplay information about optimization object (Since R2019b)
showboundsDisplay variable bounds
writeSave optimization object description (Since R2019b)
writeboundsSave description of variable bounds
fcn2optimexprConvert function to optimization expression
optimconstrCreate empty optimization constraint array
optimeqCreate empty optimization equality array (Since R2019b)
optimineqCreate empty optimization inequality array (Since R2019b)
optimexprCreate empty optimization expression array
showDisplay information about optimization object (Since R2019b)
writeSave optimization object description (Since R2019b)
evaluateEvaluate optimization expression or objectives and constraints in problem
findindexFind numeric index equivalents of named index variables
infeasibilityConstraint violation at a point
prob2structConvert optimization problem or equation problem to solver form
showDisplay information about optimization object (Since R2019b)
solveSolve optimization problem or equation problem
varindexMap problem variables to solver-based variable index
writeSave optimization object description (Since R2019b)


OptimizationConstraintOptimization constraints
OptimizationEqualityEqualities and equality constraints (Since R2019b)
OptimizationExpressionArithmetic or functional expression in terms of optimization variables
OptimizationInequalityInequality constraints (Since R2019b)
OptimizationProblemOptimization problem
OptimizationValuesValues for optimization problems (Since R2022a)
OptimizationVariableVariable for optimization


Problem-Based Steps

Steps for Global Solvers

Set Global Optimization Options

Tips for Problem-Based Optimization

Parallel Computing

Problem-Based Algorithms