This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

First Choose Problem-Based or Solver-Based Approach

There are two approaches to solving optimization problems using Optimization Toolbox™: problem-based and solver-based. Before you start to solve an optimization problem, you must first choose an approach.


The problem-based approach currently does not apply to:

  • Equation-solving

  • Nonlinear least-squares

  • Multiobjective or semi-infinite programming problems

If you have a problem of these types, use the solver-based approach Solver-Based Optimization Problem Setup.

Here is a summary of the main differences between the two approaches.

Problem-Based Optimization SetupEasier to create and debug
Not for equation-solving or nonlinear least-squares
Represent the objective and constraints symbolically
Solution time is longer because of translation time from problem form to matrix form
Does not directly allow inclusion of gradient or Hessian; see Include Derivatives in Problem-Based Workflow
See the steps in Problem-Based Workflow
Basic linear example: Mixed-Integer Linear Programming Basics: Problem-Based or the video Solve a Mixed-Integer Linear Programming Problem using Optimization Modeling. Basic nonlinear example: Solve a Constrained Nonlinear Problem, Problem-Based.
Solver-Based Optimization Problem SetupHarder to create and debug
Represent the objective and constraints as functions or matrices
Solution time is shorter because there is no translation time to matrix form
Allows inclusion of gradient or Hessian
To save memory in large problems, allows use of Hessian multiply function or Jacobian multiply function. See Quadratic Minimization with Dense, Structured Hessian or Jacobian Multiply Function with Linear Least Squares.
See the steps in Solver-Based Optimization Problem Setup
Basic linear example: Mixed-Integer Linear Programming Basics: Solver-Based. Basic nonlinear example: Solve a Constrained Nonlinear Problem, Solver-Based.

Related Topics