Main Content

Get Started with Problem-Based Optimization and Equations

Get started with problem-based setup

To solve a problem using the problem-based approach, perform these steps.

  • Create an optimization problem using optimproblem or an equation-solving problem using eqnproblem.

  • Create optimization variables using optimvar.

  • Create expressions using the optimization variables representing the objective, constraints, or equations. Place the expressions into the problem using dot notation, such as

    prob.Objective = expression1;
    probl.Constraints.ineq = ineq1;
  • For nonlinear problems, create an initial point x0 as a structure, with the names of the optimization variables as the fields.

  • Solve the problem by calling solve.

To improve your setup, increase performance, or learn details about problem-based setup, see Improve Problem-Based Organization and Performance.

For parallel computing in Optimization Toolbox™, see the last section; for parallel computing in Global Optimization Toolbox, see How to Use Parallel Processing in Global Optimization Toolbox (Global Optimization Toolbox).

Functions

expand all

eqnproblemCreate equation problem
optimproblemCreate optimization problem
optimvaluesCreate values for optimization problem (Since R2022a)
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 or objectives and constraints in problem
findindexFind numeric index equivalents of named index variables
infeasibilityConstraint violation at a point
issatisfiedConstraint satisfaction of an optimization problem at a set of points (Since R2024a)
paretoplotPareto plot of multiobjective values (Since R2022a)
prob2structConvert optimization problem or equation problem to solver form
showDisplay information about optimization object
solveSolve optimization problem or equation problem
solversDetermine default and valid solvers for optimization problem or equation problem (Since R2022b)
varindexMap problem variables to solver-based variable index
writeSave optimization object description

Objects

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 (Since R2022a)
OptimizationVariableVariable for optimization

Live Editor Tasks

OptimizeOptimize or solve equations in the Live Editor (Since R2020b)

Topics

Problem-Based Procedures

Limitations

Tune and Monitor Solution Process

Algorithms

Parallel Computing in Optimization Toolbox