Solver-Based Optimization Problem Setup
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.
To represent your optimization problem for solution in this solver-based approach, you generally follow these steps:
• Choose an optimization solver.
• Create an objective function, typically the function you want to minimize.
• Create constraints, if any.
• Set options, or use the default options.
• Call the appropriate solver.
For a basic nonlinear optimization example, see Solve a Constrained Nonlinear Problem, Solver-Based. For a basic mixed-integer linear programming example, see Mixed-Integer Linear Programming Basics: Solver-Based.
For a visual approach for optimizing or solving equations, use the Optimize Live Editor task.
- Choose a Solver
Choose the most appropriate solver and algorithm
- Write Objective Function
Define the function to minimize or maximize, representing your problem objective
- Write Constraints
Provide bounds, linear constraints, and nonlinear constraints
- Set Options
Set optimization options
- Parallel Computing
Solve nonlinear minimization, least squares, or multiobjective optimization problems in parallel