# 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

 `eqnproblem` Create equation problem `optimproblem` Create optimization problem `optimvalues` Create values for optimization problem (Since R2022a) `optimvar` Create optimization variables `show` Display information about optimization object `showbounds` Display variable bounds `write` Save optimization object description `writebounds` Save description of variable bounds
 `fcn2optimexpr` Convert function to optimization expression `optimconstr` Create empty optimization constraint array `optimeq` Create empty optimization equality array `optimineq` Create empty optimization inequality array `optimexpr` Create empty optimization expression array `show` Display information about optimization object `write` Save optimization object description
 `evaluate` Evaluate optimization expression or objectives and constraints in problem `findindex` Find numeric index equivalents of named index variables `infeasibility` Constraint violation at a point `issatisfied` Constraint satisfaction of an optimization problem at a set of points (Since R2024a) `paretoplot` Pareto plot of multiobjective values (Since R2022a) `prob2struct` Convert optimization problem or equation problem to solver form `show` Display information about optimization object `solve` Solve optimization problem or equation problem `solvers` Determine default and valid solvers for optimization problem or equation problem (Since R2022b) `varindex` Map problem variables to solver-based variable index `write` Save optimization object description

## Objects

 `EquationProblem` System of nonlinear equations `OptimizationConstraint` Optimization constraints `OptimizationEquality` Equalities and equality constraints `OptimizationExpression` Arithmetic or functional expression in terms of optimization variables `OptimizationInequality` Inequality constraints `OptimizationProblem` Optimization problem `OptimizationValues` Values for optimization problems (Since R2022a) `OptimizationVariable` Variable for optimization

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