Main Content

Problem-Based Optimization Setup

Formulate optimization problems using variables and expressions, solve in serial or parallel

In problem-based optimization you create optimization variables, expressions in these variables that represent the objective and constraints or that represent equations, and solve the problem using solve. For the problem-based steps to take for optimization problems, see Problem-Based Optimization Workflow. For equation-solving, see Problem-Based Workflow for Solving Equations.

Before you begin to solve an optimization problem, you must choose the appropriate approach: problem-based or solver-based. For details, see First Choose Problem-Based or Solver-Based Approach.

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 nonlinear optimization example, see Solve a Constrained Nonlinear Problem, Problem-Based. For a basic mixed-integer linear programming example, see Mixed-Integer Linear Programming Basics: Problem-Based. For a basic equation-solving example, see Solve Nonlinear System of Equations, Problem-Based. For an example using the Optimize Live Editor task, see Get Started with Problem-Based Optimize Live Editor Task.


expand all

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


EquationProblemSystem of nonlinear equations
OptimizationConstraintOptimization constraints
OptimizationEqualityEqualities and equality constraints
OptimizationExpressionArithmetic or functional expression in terms of optimization variables
OptimizationInequalityInequality constraints
OptimizationProblemOptimization problem
OptimizationValuesValues for optimization problems
OptimizationVariableVariable for optimization

Live Editor Tasks

OptimizeOptimize or solve equations in the Live Editor


Problem-Based Steps

Set Options

Tips for Problem-Based Optimization

Parallel Computing

Problem-Based Algorithms